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:
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!
Apple does not offer a way to handle a notification that arrives when your app is closed (i.e. when the user has fully quit the application or the OS had decided to kill it while it is in the background). If this happens, the only way to handle the notification is to wait until it is opened by the user.
If you send too many, Apple Push Notification service (APNs) throttles your requests.
Push notifications should be kept short and simple. They should be instantly readable by the user. As a rule of thumb — push notifications should be around 60–90 characters for Android, and less than 120 characters for iOS.
As a rule of thumb, do not send more than 3-5 notifications every week. Even then, make sure that the notifications have something relevant for the user. Understand how users would use your app in their daily lives and identify opportunities to enhance that experience using push messages.
go through
Targets > Capabilities > Background Modes
Turn on Background Modes
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