We're relatively new to iOS push notifications, and as always with Apple, I'm impressed by the elegance of the solution, but also slightly infuriated by what appears to be some opaque 'behind the scenes' management of the feature's behaviour.
My question is this: After successfully receiving approx. 10 separate silent push notifications at a rate of one per hour, no more were delivered to our test app until it was finally opened by our test user. Based on this it appears that iOS may stop delivering silent push notifications if it determines an app is not in use. Is this expected behaviour? Does anyone know any rough details about the heuristic used by Apple for this?
Details of the testing for those interested
FYI, our test set up is as follows:
application:didReceiveRemoteNotification:fetchCompletionHandler
delegate method)Results:
The notification format (manually copied out, excuse any errors):
aps = {
badge = 2;
"content-available" = 1;
};
I had do a lot test of my app's push function few months ago, some of my experiences here:
- Apple Push Notification doesn't care about if your app is in use or not.
- APNS is not 100% reliable, the most influential factor is network quality(your server to APN server,APN servere to your device).
- I have pushed 10,000 notifications to a iphone4s in 3 minutes, device received more than 95% notifications.So, 10 separate silent push notifications at a rate of one per hour has no pressure.
Now, have some discuss about your question:
First: Should realize that the first receiver of notifications is system,not your app.
If your app isn't in foreground, app's application:didReceiveRemoteNotification:fetchCompletionHandler will never be called until your app becomes to the foreground again. So, your " writes a log and makes a simple request to our backend server" action is not suitable to "logs the event having occurred".
I think there is not a good way to "logs all the event having occurred" unless your app is always in foreground.
BTW: when you are testing push,if device doesn't reveive notification quickly,you could change device's network (or turn off then turn on network),sometimes,the notification will come soon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With