开发者

How can I identify when the iphone app is NOT opened due to a push notification?

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 didFinishLaunchingWi开发者_JAVA技巧thOptions 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 :)


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/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜