ios - 从横幅/自定义操作启动应用程序时未调用 applicationDidBecomeActive

标签 ios push-notification apple-push-notifications ios8

我在尝试实现 iOS-8 的新交互式通知时遇到了这个奇怪的问题。在处理本地通知时,一切都按预期工作,但在处理 APNS 时,一切都不太顺利。

详细信息:我通过横幅获得自定义推送(我只注册到最小上下文),但是当用户点击代表自定义操作的按钮时,我的应用程序的委托(delegate)applicationDidBecomeActive: 未被调用;事实上 - 该应用程序卡在非事件模式。

奇怪的是,当从“通知”屏幕(“今天”的右侧)启动时,该应用确实进入了事件模式。 除此之外,在这两种情况下,我的代表:

handleActionWithIdentifier:forRemoteNotification:completionHandler:

确实使用正确的标识符调用。

非常感谢任何帮助!

最佳答案

看起来这是一个 iOS 8 错误。在 Urban Airship 的 iOS 变更日志文档中发现如下内容:

iOS 8 Notes (Updated September 25, 2014)

Known issues with iOS 8.0.0 that may impact your application: - Applications do not enter the 'active' state when started from an interactive notification and subsequent app sessions do not receive the application:didBecomeActive delegate call or
UIApplicationDidBecomeActiveNotification notification. The application state never transitions out of 'inactive' (Radar #18179525). This will impact the accuracy of reporting for applications using interactive notifications.

http://docs.urbanairship.com/reference/libraries/ios/latest/ios_changelog.txt

我没有发现任何迹象表明此问题已在最新的 iOS 8 版本(包括 8.1 和 8.2-Beta)中得到修复,也没有找到任何解决方法来解决它。

关于ios - 从横幅/自定义操作启动应用程序时未调用 applicationDidBecomeActive,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26059927/

相关文章:

iphone - 如何在 ios6 iphone 应用程序中创建使用 Facebook 或 twitter 登录

带有 GCM 的 iOS 推送通知

来自服务器的 Android 通知

iOS - 无法使用 APNS 证书创建新的配置文件

ios - 如何水平翻转图片保存翻转到相册?

php - 无法连接到苹果推送通知服务器进行生产

ios - 在 swift 中使用标记聚类时,如何向我的苹果 map 上的图钉添加注释 View ?

ios - 新站推送和执行代码

ios - 有时不调用 didRegisterForRemoteNotificationsWithDeviceToken 方法

ios - 从服务器向客户端发送通知,除了 Apple Push Notification 之外没有别的选择吗?