I’m using the Push Notification Widget on my Iphone 7, and I was wondering if I could receive some help as I am having a lot of trouble with it. No matter what code or hardware I try, Blynk.notify does not send notifications to my phone. It is read in my Arduino code, but no notification is sent. (I know it is read because the lines of code before are after it are being done). I have tried many different codes, devices, deleting the widget, etc. The email widget (Blynk.email) does not work as well (I have used many other widgets and I only seem to have a problem with these two). This is an example of a code I used- I wired my button to GRND and digital pjn 2. Any suggestions?
#define BLYNK_PRINT Serial
#include <SoftwareSerial.h>
SoftwareSerial SwSerial(10, 11); // RX, TX
#include <BlynkSimpleSerialBLE.h>
#include <SoftwareSerial.h>
char auth[] = "xxxxxxxxxx";
SoftwareSerial SerialBLE(10, 11); // RX, TX
void notifyOnButtonPress()
{
int isButtonPressed = !digitalRead(2);
if (isButtonPressed) {
Serial.println("Button is pressed.");// This works
Blynk.notify("Yaaay... button is pressed!"); // never is received on Iphone
}
}
void setup()
{
// Debug console
Serial.begin(9600);
SerialBLE.begin(9600);
Blynk.begin(SerialBLE, auth);
Serial.println("Waiting for connections...");// this works
// Setup notification button on pin 2
pinMode(2, INPUT_PULLUP);// i have wired my button as pullup
// Attach pin 2 interrupt to our handler
attachInterrupt(digitalPinToInterrupt(2), notifyOnButtonPress, CHANGE);
}
void loop()
{
Blynk.run();
}