iOS - 在应用被终止时处理静默推送通知

iOS - Handling Silent Push Notifications When App Is Killed

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

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

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

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

如 Apple 所述 - application:didReceiveRemoteNotification:fetchCompletionHandler:,您无能为力:

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.

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