从横幅/自定义操作启动应用程序时未调用 applicationDidBecomeActive [英] applicationDidBecomeActive not called when launching app from Banner/custom action

查看:21
本文介绍了从横幅/自定义操作启动应用程序时未调用 applicationDidBecomeActive的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在尝试实现 iOS-8 的新交互式通知时遇到了这个奇怪的问题.在处理本地通知时,一切都按预期工作,但当涉及到 APNS 时,情况就不太妙了.

I'm facing this weird problem while trying to implement iOS-8's new Interactive Notifications. When dealing with Local Notifications everything works as expected, but when it comes to APNS - things do not work well.

详细说明:我通过横幅获得了应有的自定义推送(我仅注册到最小上下文),但是当用户点击代表自定义操作的按钮时,我的应用程序的委托applicationDidBecomeActive:没有被调用;事实上 - 应用卡在非活动模式.

In details: I get the custom push as it should through the banner (I register only to the minimal context), but when the user taps the button that represents the custom action, my application's delegateapplicationDidBecomeActive: is not called; In fact - the app gets stuck on an inactive mode.

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

The weird thing is that the app does go to active mode when launched from the Notifications screen (The one to right of the Today). Beside that, on both cases, my delegate:

handleActionWithIdentifier:forRemoteNotification:completionHandler:

使用正确的标识符调用.

does get called with the right Identifier.

非常感谢任何帮助!

推荐答案

看起来这是一个 iOS 8 Bug.在 Urban Airship 的 iOS 更改日志文档中找到以下内容:

Looks like this is an iOS 8 Bug. Found the following on Urban Airship's iOS change log document:

iOS 8 注释(2014 年 9 月 25 日更新)

iOS 8 Notes (Updated September 25, 2014)

可能会影响您的应用程序的 iOS 8.0.0 已知问题:- 从交互式通知启动时,应用程序不会进入活动"状态,并且后续的应用程序会话不会收到应用程序:didBecomeActive 委托调用或
UIApplicationDidBecomeActiveNotification 通知.应用程序状态永远不会从非活动"状态转换出来(Radar #18179525).这个将影响使用的应用程序报告的准确性交互式通知.

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)中得到修复,也没有任何解决方法可以解决此问题.

I Did not find any indication that this had been fixed in the latest iOS 8 versions, including 8.1 and 8.2-Beta, nor any workaround to deal with it.

这篇关于从横幅/自定义操作启动应用程序时未调用 applicationDidBecomeActive的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆