Reputation: 87
I'm trying to use Apple push notifications. Everyting works fine except when app is in background.
The callback method DidRecieveRemoteNotification
is sometimes not called immediately after notification is received. Sometimes it takes more then 5 minutes to be invoked. Is this standard behavior?
When the app is running in foreground callback method is called right after receiving notification. I would like the same behavior even when app is in background.
Upvotes: 0
Views: 56
Reputation: 8465
Silent notifications will invoke their callback immediately when in the background as their purpose is to wake the app up for a short period of time.
In order to save battery, regular push notifications won't invoke the callback while in the background (unless your app is executing something else in the background). The callback will be called the next time the app is opened, whether from tapping the notification or otherwise.
This is not something you can fix, this is how the eco-system works. If you need your app to do something immediately, you will have to use silent notifications
Upvotes: 1