Skip to content
New issue

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

Error compiling for board NodeMCU 1.0 (ESP-12E Module) #1

Open
jssahoo opened this issue Apr 18, 2020 · 1 comment
Open

Error compiling for board NodeMCU 1.0 (ESP-12E Module) #1

jssahoo opened this issue Apr 18, 2020 · 1 comment

Comments

@jssahoo
Copy link

jssahoo commented Apr 18, 2020

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
}

@Nightsd01
Copy link
Owner

Hi @jssahoo, apologies for the slow response! What kind of compiler error are you getting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants