When the user selects the remote notification, the following callback is launched in the application delegate:
-application:didReceiveRemoteNotification:fetchCompletionHandler:
in this case, the application starts, and the state of the application is UIApplicationStateActive , which I interpret as a user that is executed when the notification is deleted.
problem: This method can also be called when a remote notification arrives, and the application is in the foreground with an inactive state .
Example : when you open the notification center window (swipe down the top edge of the screen) or UIAlert is open. In both cases, the state of the application is UIApplicationStateActive , and there is no way to find out if a user notification was received or a system click was received.
Q : how can I determine if the didReceiveRemoteNotification response to a user call with a remote notification and the arrival of a remote notification?
source share