We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am Getting compling error. Arduino IDE-1.8.12 ESP8266- 2.6.3
Modified Onesignal.h for ESP8266
Sketch:
#define OS_ESP8266
#include <ESP8266WiFiMulti.h> #include <OneSignal.h>
// Replace with your own OneSignal App ID #define OS_APP_ID "YOUR_ONESIGNAL_APP_ID_HERE"
// Run your app and put your own player ID here for testing #define OS_USER_ID "YOUR_ONESIGNAL_USER_ID"
// Your wifi network name #define WIFI_SSID "example_wifi_network"
// Your wifi network password #define WIFI_PASSPHRASE "example_wifi_passphrase"
OneSignal onesignal(OS_APP_ID);
ESP8266WiFiMulti wifiMulti;
void setup() { Serial.begin(115200);
Serial.println("Connecting to wifi");
wifiMulti.addAP(WIFI_SSID, WIFI_PASSPHRASE);
while (wifiMulti.run() != WL_CONNECTED) { //Wait for the WiFI connection completion delay(500); Serial.println("Waiting for connection"); }
Serial.println("Connected to " + String(WIFI_SSID));
// Build & send a push notification OSNotification notif; notif.contents = "Hello, World!"; notif.headings = "Test Title"; notif.url = "https://www.google.com";
Serial.println("Built notification, building audience");
OSAudience audience(OS_USER_ID);
String result = onesignal.sendNotificationToAudience(notif, audience);
Serial.println("Sent with result:"); Serial.println(result); }
void loop() { // No-op }
The text was updated successfully, but these errors were encountered:
Hi @jssahoo, apologies for the slow response! What kind of compiler error are you getting?
Sorry, something went wrong.
No branches or pull requests
I am Getting compling error.
Arduino IDE-1.8.12
ESP8266- 2.6.3
Modified Onesignal.h for ESP8266
Sketch:
#define OS_ESP8266
#include <ESP8266WiFiMulti.h>
#include <OneSignal.h>
// Replace with your own OneSignal App ID
#define OS_APP_ID "YOUR_ONESIGNAL_APP_ID_HERE"
// Run your app and put your own player ID here for testing
#define OS_USER_ID "YOUR_ONESIGNAL_USER_ID"
// Your wifi network name
#define WIFI_SSID "example_wifi_network"
// Your wifi network password
#define WIFI_PASSPHRASE "example_wifi_passphrase"
OneSignal onesignal(OS_APP_ID);
ESP8266WiFiMulti wifiMulti;
void setup() {
Serial.begin(115200);
Serial.println("Connecting to wifi");
wifiMulti.addAP(WIFI_SSID, WIFI_PASSPHRASE);
while (wifiMulti.run() != WL_CONNECTED) { //Wait for the WiFI connection completion
delay(500);
Serial.println("Waiting for connection");
}
Serial.println("Connected to " + String(WIFI_SSID));
// Build & send a push notification
OSNotification notif;
notif.contents = "Hello, World!";
notif.headings = "Test Title";
notif.url = "https://www.google.com";
Serial.println("Built notification, building audience");
OSAudience audience(OS_USER_ID);
String result = onesignal.sendNotificationToAudience(notif, audience);
Serial.println("Sent with result:");
Serial.println(result);
}
void loop() {
// No-op
}
The text was updated successfully, but these errors were encountered: