Giter Site home page Giter Site logo

Comments (3)

svdrummer avatar svdrummer commented on June 12, 2024

THis is the example sketch as supplied with the library for an ESP8266

#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <Pushsafer.h>

// Initialize Wifi connection to the router
char ssid[] = "ssid"; // your network SSID (name)
char password[] = "password"; // your network key

// Pushsafer private or alias key
#define PushsaferKey "XXXXXXXXXXXXX"

WiFiClientSecure client;
Pushsafer pushsafer(PushsaferKey, client);

void setup() {
Serial.begin(115200);

// Set WiFi to station mode and disconnect from an AP if it was Previously
// connected
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);

// Attempt to connect to Wifi network:
Serial.print("Connecting Wifi: ");
Serial.println(ssid);
WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(500);
}

Serial.println("");
Serial.println("WiFi connected");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());

pushsafer.debug = true;

struct PushSaferInput input;
input.message = "This is a test message";
input.title = "Hello!";
input.sound = "8";
input.vibration = "1";
input.icon = "1";
input.device = "a";

// API description: https://www.pushsafer.com/en/pushapi
// Other optional Options
// input.url;
// input.urlTitle;
// input.picture;
// input.picture2;
// input.picture3;
// input.time2live;

Serial.println(pushsafer.sendEvent(input));
Serial.println("Sent");
}

void loop() {
}

from pushsafer-arduino-library.

appzer avatar appzer commented on June 12, 2024

for me all works fine! I'am not a pro for arduino. So please search help from Arduino users in a forum like this: https://forum.arduino.cc/

from pushsafer-arduino-library.

svdrummer avatar svdrummer commented on June 12, 2024

I have just reloaded the library. Seems different than a few days ago.
The CPP code has changed. Now it works okay.
Cheers
To help others. Make sure your library example starts with
#include <ESP8266WiFi.h>
/#include <WiFiClientSecure.h>/
#include <WiFiClient.h>
#include <Pushsafer.h>
If anything different, it will not compile
Matter closed

from pushsafer-arduino-library.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.