My app performs silent background fetch via push notifications. Everything is working fine, and push notifications sent from our server trigger silent background fetches as expected, when the user has opened the app within the last 60 minutes or a push notification has been sent within 60 minutes - even if the device is locked.
However, when the user doesn't open the app for 2-3 hours or when a push notification hasn't been sent in 2-3 hours, the app isn't receiving the push notification. I have been logging app activity, and I've confirmed that:
didReceiveRemoteNotification:fetchCompletionHandler:
is not being called on the app delegate.
A few more facts:
- In the app's plist.info, I have set UIRequiresPersistentWiFi to true and UIBackgroundModes to (only) remote-notification
- The push notification payload contains only the content-available key
- After 2-3 hours of inactivity (either from no push notification sent or no user activity), I am seeing the same result on both my iPhone 5 and Wifi-only iPad 2, both running iOS 8.1.2. In other words, it doesn't matter whether the internet connection is cellular or Wifi.
- I don't believe I am hitting rate-limit boundaries, as I am only sending at most 1-2 push notifications per device per hour.
My understanding is that iOS should continue to wake the app up in the background and enable it to process the background fetch from the push notification - even after hours of inactivity (as long as the device is awake and has an internet connection).
I'm wondering if anyone else has experienced this, and if so, if you've found a workaround.
Thanks in advance!