iOS Question Silient Push works in background IOS 9 and not working in IOS 11

Humberto

Active Member
Licensed User
Longtime User
The same software instaled in Iphone 4S and Iphone 6 when the apk is in background and I send a Silent Push to each one the Iphone 4S receive and Iphone 6 ( IOS 11.2.6 ) doesn´t.

In Iphone 6 when I call the apk it receives the push

I don´t know why
 

Humberto

Active Member
Licensed User
Longtime User
The APK is in test flight att Apple and I downloaded in both phones from there.

I'm sure that both are in memory.

In iPhone 6 I receive Just when the APK is in foreground
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
Did you read that?

https://www.b4x.com/android/forum/t...-with-silent-push-and-firebase.71306/#content

I had the same problem and after testing a lot of, i did not use silent push anymore. I don't think, that it is a bug. It seems to have something to do with the new and more restective energie policies under IOs 11. Silent push messages will only arrive under later IOs-versions, if the energie-state will allow it. So i mentioned, that silent push is not very reliable. Did you try to push the iPhone 6 when it is power connected?

Here some more informations:

http://stackoverflow.com/questions/...vered-if-device-is-charging-and-or-app-is-for
,

I found this:

https://developer.apple.com/library/content/technotes/tn2265/_index.html#//apple_ref/doc/uid/DTS40010376-CH1-TNTAG23

If your notification payload contains the content-available key, your app will receive the notification if iOS or OS X determines it is energy-efficient to do so. If the energy or data budget for the device has been exceeded, your app will not receive any more notifications with the content-available key until the budget has been reset. This occurs once a day and cannot be changed by user or developer action. This throttle is disabled if the app is run from Xcode, so be sure to test your app by running it from the device to have the same user experience your customers will have.

All of this points out that the intent is that a notification indicates to an app that something of interest has changed on the provider, and the app should check in with the provider to get the details. Notifications should not contain data which isn't also available elsewhere, and they should also not be stateful.


It seems not to be possible to make sure, that the app reads the content-data after an silent push arrives. After testing it with more than 100 users, the determin, that starting the app in not energy-efficient, happens very often. As Erel told in many threads berfore, that it is not possible to rely on push-messages and always make sure to load the needed data from server, silent push is no reliable tool. So far, i didn't thought, that apple controls this feature so massively.
I now use normal push together with content-available-data. If the app is not able to read the content-data, the app makes a synch with the server to download all, which is needed.
 
Last edited:
Upvote 0

Humberto

Active Member
Licensed User
Longtime User
I use this function to awake my software to go to server and get some information.

What else can I do to do this feature ?
It´s an alarm program that receive a trigger to start receiving/transmit information from/to server.
The program will be usualy in background.

I´ll try to send push notification with no data and see if I can receive.
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
Perhaps background fetch could work, if your app doesn't need to sync at a special time...
 
Upvote 0

Humberto

Active Member
Licensed User
Longtime User
I succeed in receive a Silent Push Notification for a day using this.

In server ( in my case PHP ) I setup " 'content_available' => false "

In B4I program
- I don´t call "fm.FCMDisconnect " in "Private Sub Application_Background"
- Maintain active "Location Manager" so I continuosly receive location
- in "Sub LocManager_LocationChanged (Location1 As Location)" I call "fm.FCMConnect" every time if the apk is in background

Pros
- It receive almost immediatly the silent push notification ( like in android ) even if the phone is in stand by

Against
- Drain battery


I tryed to implement "Fetch download" expected to be awake maximum every 30 minutes but I got no succeed.
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
Wow, that's a trick, but you now only use FCM-Push in your app and no apn. If the device is not reachable or the app is in background, fcm sends the push to the apple push service. After that, apple is responsible for the push. The advantage is also, that fcm is able to save more than only the last push-message like apn does. If you make such a solution, it might be better to make a polling over the fetch download or the loc_manager with downloading the data over http or websocket. So you can exclude the uncertainty push factor.
 
Upvote 0

Humberto

Active Member
Licensed User
Longtime User
The fetch download doesn´t work for me, just work if the phone is connected to power.
The push notification is receiving by the phone even when the cellphone is with screen off and all app is in background.
To pool to the server will consume internet data that is not good.

If you know other way to be awake every x minutes I will test here.
 
Upvote 0
Top