ios - 解锁 iPad 时推送通知警报会打开应用程序

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

我开发了使用苹果推送通知的 iPad 应用程序。推送通知在所有情况下都可以正常工作,除非 iPad 设备被锁定且通知已发送。在这种情况下,它的行为很奇怪,当您滑动解锁设备而不触摸警报/横幅时,它会打开应用程序。它发生在 iOS 版本 4.3、5.1 以及 6.0 中

在苹果文档中他们提到如下:

http://developer.apple.com/library/ios/#DOCUMENTATION/NetworkingInternet/Conceptual/RemoteNotificationsPG/IPhoneOSClientImp/IPhoneOSClientImp.html

iOS Note: If the user unlocks the device shortly after a remote-notification alert is displayed, the operating system automatically triggers the action associated with the alert. (This behavior is consistent with SMS and calendar alerts.) This makes it even more important that actions related to remote notifications do not have destructive consequences. A user should always make decisions that result in the destruction of data in the context of the application that stores the data.

与警报相关的操作是什么?
操作系统自动触发与警报相关的操作

我还想了解这种情况下的默认行为是什么?

感谢任何帮助,并提前致谢。

最佳答案

它的行为并不奇怪,因为这是默认行为。当您的通知点亮屏幕时,“滑动解锁”变为“滑动查看”,这将打开您的应用并执行与您的通知相关的操作。

默认操作是,如果您不指定要发生的任何事情,则不会发生任何事情。

要处理通知(即与警报相关的操作),请参阅文档:Link ,处理本地和远程通知部分

关于ios - 解锁 iPad 时推送通知警报会打开应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12222043/

相关文章:

ios - 快速滚动时自定义标题内容动画

ios - 如何在应用程序加载前将我的 iPad 设置为横向模式?

ios - APNS2 错误 400 : DeviceTokenNotForTopic - Getting this error when sending Push Notification via PubNub

ios - 应用程序关闭时 didFinishLaunchingWithOptions APNS

ios - 应用内购买 freshplanet-as3

android - Polymer StarterKit在PhoneGap/Cordova上不起作用

iphone - 如何执行转场

iphone - 模拟对象的惯性滚动

cocoa - 通过 iPad 应用程序使用 Instruments 'Allocation'

ios - 以编程方式检测正在使用的开发或生产推送通知证书