My issue is like this.
I send a request to a server asking to notify me of an event that will occur in 2 to 10 minutes and close the app, and the server will answer to that request via a push notification. Until the server responds with the notification, the app shows an animation, just in case it stays in the foreground.
When i receive the notification, when the app is opened, the animation has to stop and display some data from the notification.
My problem is, if i don’t open the app from the notification (i open it from the icon), the animation continues to show because the callback method for “didReceiveRemoteNotification” never gets called..
Is it possible to check if an app was opened from the icon or from a notification (local or push)?
The
application:didFinishLaunchingWithOptions:paragraph of the SDK help explains very well which delegate methods are called in different start / wake up scenarios (for example clicking registered URL handler, opening a supported mime type, answering to remote / local notifications, clicking on the icon on the home screen, etc)Also, if your application is already running at the time of the above events, the appropriate delegate methods will be called (for example
didReceiveRemoteNotification,openURL, etc.) apart fromapplicationDidBecomeActive:. From the combination of the called callbacks you can figure out which event happened.