gpt4 book ai didi

iOS - 在应用程序被杀死时处理静默推送通知

转载 作者:可可西里 更新时间:2023-11-01 03:53:33 25 4
gpt4 key购买 nike

我目前在 iOS 中遇到推送通知问题。

我的应用程序收到包含标识符的静默推送通知。然后使用此标识符从创建本地通知的远程服务器获取数据。

据我所知,如果用户强制退出应用程序(即通过双击主页按钮并滑动关闭应用程序),则静默推送通知不会传递到 AppDelegate 中的 didReceiveRemoteNotification 方法类 [1] [2],从而阻止应用程序进行任何类型的处理。

我已经对处理上述情况进行了大量研究。但是,无法找到明确的答案,希望有人能帮助我或指出正确的方向。

最佳答案

如文件所示
- application:didReceiveRemoteNotification:fetchCompletionHandler:
由 Apple,您无能为力:

However, the system does not automatically launch your app if the user has force-quit it. In that situation, the user must relaunch your app or restart the device before the system attempts to launch your app automatically again.

这样做是为了让用户可以停止不需要的通知

关于iOS - 在应用程序被杀死时处理静默推送通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35292348/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com