silent push notifications stop after a while

I'm using silent push notificatoins (with content-available=1) to wake my app up in the background in order that it can download some content. It works for a while, it even launches the app in the background if the OS had previously killed it. But eventually the OS starts to ignore the push notifications. I see this in the logs:


SpringBoard(AppLaunchStats)[4455] <Notice>: High Priority Push: myapp - Disabled for Sleep
SpringBoard(AppLaunchStats)[4455] <Notice>: High Priority Push: myapp - App not running


And from this point my app needs to be manually launched in order to start receiving notifications again. What causes this to happen?

The OS can determine when it is energy efficient to send the push notification to the device.


"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."


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


Hope this helps,

DT

Thanks for the info. It would be nice to be able to confirm this is the case. I can't see any error messages to indicate that its a power usage problem yet. I've enabled the PersistentConnectionLogging, maybe that will help.

I would say battery life does play a role, but even at 100% battery life, I still cant get the silent notification to work sometimes.

See the other post on this forum, '

Silent Push Notifications No Longer Work in iOS 10'

shows how to fix this issue, or what we did to get it working again.

silent push notifications stop after a while
 
 
Q