According to didReceiveRemoteNotification, when in the background , we used to process the user opening the application by pressing the action button on the push notification (or scrolling through the push notification, depending on how the user sees the push notification) by implementing -application:didReceiveRemoteNotification: and then checking inside the method whether the application applicationState inactive.
IOS 7 has a new remote-notification background mode that allows the application to perform background extraction when a remote notification is displayed to the user (without the need for the user to make any notification). To support this mode, you must implement the -application:didReceiveRemoteNotification:fetchCompletionHandler: .
The documentation for -application:didReceiveRemoteNotification: says that if your application delegate implements the application:didReceiveRemoteNotification:fetchCompletionHandler: , then "the application object calls this method instead." This means that we can no longer use -application:didReceiveRemoteNotification: to handle remote notifications, since it will not be called.
We should probably put the processing logic in application:didReceiveRemoteNotification:fetchCompletionHandler: but the previous trick for processing it no longer makes sense - previously we depended on the only way for -application:didReceiveRemoteNotification: be called when the application is inactive if the user clicked the action button in the notification to open the application. However, now the whole point of the remote-notification background mode is that it can call application:didReceiveRemoteNotification:fetchCompletionHandler: in the background every time a remote notification is received before the user does something with it.
So, how can we now say when the user opens the application using the action button in the notification?
source share