1
votes

I understand you can capture the fact that an app has opened due to a Push notification.

  • App not in the background = didFinishLaunchingWithOptions and evaluate launchOptions for "aps"
  • App in background = didReceiveRemoteNotification is called

Of course in didFinishLaunchingWithOptions I can also differentiate with opening the app normally via the icon by the absence of "aps"

However, if the app is in the background and is opened normally via the icon where can I identify this? There is no specific event method called on the delegate and I only get applicationWillEnterForeground which is called either way with no launchOptions to examine.

My scenario is the user gets a push (changing the badge number), closes it (app will not know about it now) and then later opens the app. The change in badge tells me in lieu of a push open that something has changed outside of the app requiring some behaviour.

Thx :)

1

1 Answers

0
votes

After some searching I found some discussion here about checking the application state.

http://www.nomadplanet.fr/2010/09/the-incomplete-implementation-of-push-notifications/