【问题标题】:How can I identify when the iphone app is NOT opened due to a push notification?如何识别由于推送通知而未打开 iphone 应用程序的时间?
【发布时间】:2011-06-09 05:23:55
【问题描述】:

我知道您可以捕捉到应用程序由于推送通知而打开的事实。

  • 应用不在后台 = didFinishLaunchingWithOptions 并为“aps”评估 launchOptions
  • 后台应用 = didReceiveRemoteNotification 被调用

当然,在 didFinishLaunchingWithOptions 中,我也可以通过没有“aps”来区分通过图标正常打开应用程序

但是,如果应用程序在后台并通过图标正常打开,我在哪里可以识别?没有在委托上调用特定的事件方法,我只得到 applicationWillEnterForeground,它被调用,没有要检查的 launchOptions。

我的场景是用户收到推送(更改徽章编号),关闭它(应用程序现在不会知道它)然后打开应用程序。徽章的变化告诉我,在应用程序之外发生了一些变化,需要一些行为。

谢谢:)

【问题讨论】:

    标签: apple-push-notifications


    【解决方案1】:

    经过一番搜索,我发现这里有一些关于检查应用程序状态的讨论。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多