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