Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS - Handling Silent Push Notifications When App Is Killed

I am currently facing a problem with push notifications in iOS.

My app receives silent push notifications containing an identifier. This identifier is then used to fetch data from a remote server from which a local notification is created.

As far as I'm aware, if the user has force-quit an app (i.e. by double tapping the home button and swipe closing the app) then the silent push notification does not get passed onto the didReceiveRemoteNotification method in the AppDelegate class [1] [2], thus preventing the app from doing any kind of processing.

I have done a fair amount of research into handling the situation mentioned above. However, was unable to find a definitive answer and was hoping someone could help me out or point me in the right direction.

like image 467
Raveendra24 Avatar asked Feb 09 '16 12:02

Raveendra24


1 Answers

As documented - application:didReceiveRemoteNotification:fetchCompletionHandler: by Apple, there is not much you can do:

However, the system does not automatically launch your app if the user has force-quit it. In that situation, the user must relaunch your app or restart the device before the system attempts to launch your app automatically again.

It is done so that users could stop unwanted notifications

like image 177
Mindaugas Avatar answered Sep 23 '22 17:09

Mindaugas