iOS Update and Push Notifications

We use Google notifications server. All the delays might be caused by them.

The pop-up alerts overwrite all of your notifications settings only when the app is open. We will change it over time to our custom internal messages. Banners are prohibited by Apple when app is open.

Check your notifications settings, my iPhone gets them on the lock screen and when the phone is off. I even get them on the Apple watch.

I wonder if this will work in mainland China. Every piece of code related to google is blocked here. The recent change in structure aat google becoming a part of Alphabet.inc was caught up really quickly here. The website was already blocked on the same day. I was using google app engine before, It cannot be accessed anymore unless you have VPN.
I will test PN function soon. And keep you posted. Got a lot to discuss as you mentioned earlier. :wink:

Oh… :neutral_face: So not really something that will be an easy fix?

With the cloud based server I’m getting delays of up to 4 seconds from the time of pressing the button on the dash to when the device reacts and starts the activity, with the local server its around 80-100ms response, thus for me using the local server is quite crucial.

You mean delays for PN? In that case it doesn’t matter local server or not. Cause this is google servers itself provides a delay. For Android it works well but for iOS for some reason there are delays.

No, not on the PN, on normal operating conditions:

i.e. if i press the button on the Dashboard → send High to the Primary Arduino → High via Bridge to Secondary Arduino → Open Relay via Cloud server takes about 4 seconds, via local its ā€œinstantā€

I expect the traffic for the example would look something like:

Mobile Device app → Cellular Service Provider → Cloud Server → Fixed Line Service Provider (DSL) → Arduino #1 → Fixed Line Service Provider (DSL) → Cloud Server → Fixed Line Service Provider (DSL) → Arduino #2

Compared to local:

Mobile Device app → Cellular Service Provider → Fixed Line Service Provider (DSL) → Arduino #1 → local Server → Arduino #2

@Bobbo_SA

Ah, Ok. for that case yes - local server would be the best option. Regarding PN on local server… Well, I could implement it very quickly for Android and it will work. But with iOS it is not so simple.

Is Twitter supported via local server yet? - Sorry, i have not tested yet

If it is then I can use that as a notification by sending a tweet to a private account and adding the notification through the twitter iOS client

Update: Twitter on the latest 0.7.4 also does not work

PN on android never works for me. At last I think i find the reason. I’m from mainland of China:)

@juncaofish

That’s interesting! I never saw in google docs that they don’t provide pushes for China. I’ll check that.

Its the problem with policy here. Actually no google product is available. The Great Chinese Firewall blocks everything. I might have a solution, maybe you can PM me :smile:

ä½ ę€Žä¹ˆäø‹č½½ Blynk app å‘¢ļ¼Ÿę˜Æē›“ęŽ„ę‰¾åˆ° apkå—ļ¼Ÿ

Ok, you’re right. GCM doesn’t work in China =(. And there is no quick way to fix it =(.

For some reason…Notifications were working much better tonight…Until I shut down the Blynk App.
QUESTION: Does the app need to be open to receive notifications? (iOS)

I use Google Play on Nexus4 to install/upgrade Blynk.Also another app named čµ›é£Ž is used to cross the wall while doing this.

No. But we have limit on number of notifications user can send. Right now it is 1 notification within 1 minute.

Yup…I know about the 1 minute rule, but I am not getting notifications when the app isn’t running my iPhone.

Please make a screenshot of your notifications settings, describe how you send them(code), describe your hardware set up.

We’ll start from there

This is all just a test playground…
iOS, Arduino Uno, SeeedStudio Ethernet Shield V2.0

I have 3 LEDs, 2 PWM LEDs, 4 Relays, a DHT11 Temp sensor, and I have the receiving end of a wireless doorbeel attached to my arduino’s pin 19. See doorBell function.
Thanks for looking.

// Libraries
    #include <SPI.h>
    #include <EthernetV2_0.h> //SeeedStudio Ethernet Shield
    #include <BlynkSimpleEthernetV2_0.h> //Blynk Library for Seeed Shield
    #include <SimpleTimer.h> //Timer
    #include <dht.h> //DHT11 Temp/Humidity Sensor Library
    
    
    // Define Ethernet Shield Pin and SD Card Pin
    #define W5200_CS  10
    #define SDCARD_CS 4
    
    
    // Initiate DHT11 Temperature/Humidity Sensor on Pin 17
    dht DHT;
    #define DHT11_PIN 17
    
    
    // BLYNK Authorization Code
    char auth[] = " ";
    
    
    // SimpleTimer
    SimpleTimer timer;
    
    
    // Celcius to Farenheit Conversion
    double Fahrenheit(double celsius)
    {
    	return 1.8 * celsius + 32;
    }
    
    
    //Temp to Virtual Pin 4 - Humidity to Virtual Pin 3
    void sendDHT()
    {
    	DHT.read11(DHT11_PIN);
    	Blynk.virtualWrite(V4, Fahrenheit(DHT.temperature));
    	Blynk.virtualWrite(V3, DHT.humidity);
    }
    
    
    //Uptime to Virtual Pin 5 - Milliseconds/1000 = 1 sec
    void sendUptime()
    {
    	Blynk.virtualWrite(V5, millis() / 1000);
    }
    
    
    //ALL LEDs - ON & OFF
    BLYNK_WRITE(V1)
    {
    	if (param.asInt())
    	{
    		digitalWrite(14, HIGH);
    		digitalWrite(15, HIGH);
    		digitalWrite(16, HIGH);
    		digitalWrite(9, HIGH);
    		digitalWrite(3, HIGH);
    	}
    	else
    	{
    		digitalWrite(14, LOW);
    		digitalWrite(15, LOW);
    		digitalWrite(16, LOW);
    		digitalWrite(9, LOW);
    		digitalWrite(3, LOW);
    	}
    }
    
    
    void doorBell()
    {
    	int dbPressed = digitalRead(19);
    	if (dbPressed == HIGH)
    	{
    		digitalWrite(14, HIGH);
    		delay(500);
    		digitalWrite(14, LOW);
    		Blynk.notify("Ding-Dong! Someone is at the door!");
    		
    		// Blynk.email("email@gmail.com", "Ding-Dong!", "Ding-Dong! Someone is at the door!");
    		// Blynk.tweet("My Arduino project is tweeting using @blynk_app and it’s awesome!\n #arduino #IoT #blynk");
    		delay(2500);
    	}
    } //End doorBell
    
    
    void setup()
    {
    	Serial.begin(9600);
    	pinMode(SDCARD_CS, OUTPUT); //Define SDCard Pin as Output
    	digitalWrite(SDCARD_CS, HIGH); // Deselect the SDCard
    	Blynk.begin(auth);
    	while (!Blynk.connect())
    	{
    		// Wait until connected
    	}
    
        timer.setInterval(1000L, sendUptime);
    	timer.setInterval(1000L, sendDHT);
    	timer.setInterval(1000L, doorBell);
    } //End Setup
    
    
    void loop()
    {
    	Blynk.run(); //Loop Blynk
    	timer.run(); //Loop SimpleTimer Commands
    
    } //End Loop

Just as an experiment, try putting notification string on top of everything else. I once had similar issue, but it was hard to reproduce.

You should also try use only notification and remove all the rest. As a test

Test complete. Same results for all. (Ignoring the delays from Google, there may be slight delays from the delays that are there as a debounce for the doorbell).

Notify below the LED blink commands:
- Works when app is running.
- Doesnt work when app is closed.

Notify on top of the LED blink commands:
- Works when app is running.
- Doesnt work when app is closed.

Notify without the LED blink commands (No delay debounce):
- Works when app is running.
- Doesnt work when app is closed.

Though these results are sadly consistent, the Google service is much too inconsistent, making it unusable for certain applications.

I’m hoping there is a fix for my notifications not working when the app is closed.