gpt4 book ai didi

ios - 即使在应用程序被删除 iPhone 后仍收到推​​送通知

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

我在我的应用中实现了推送通知。

它工作正常。

现在的问题是,即使我从设备上删除了我的应用程序,它仍会收到推送通知。

那么,当应用程序从设备中删除时,有什么方法可以从推送通知中注销该应用程序。

希望得到您的帮助。

提前致谢。

最佳答案

在 Apple 推送通知中有一个叫做反馈服务的东西。因此,当用户删除应用程序时,服务提供商最好停止向该设备发送通知。但 Apple 不会通知该服务“此设备未使用您的应用程序,请勿发送通知”。因此,您需要轮询此信息。

您可能每天都需要点击 Apple 通知服务器,要求它为您提供已删除您的应用程序的设备 ID。一旦你得到它们,你就在你的数据库中将它们标记为已删除,从而不再发送任何通知。希望这就是您想要的。

来自 Apple Documentation -

... Apple Push Notification Service includes a feedback service that APNs continually updates with a per-application list of devices for which there were failed-delivery attempts. The devices are identified by device tokens encoded in binary format. Providers should periodically query the feedback service to get the list of device tokens for their applications, each of which is identified by its topic. Then, after verifying that the application hasn’t recently been re-registered on the identified devices, a provider should stop sending notifications to these devices.

Access to the feedback service takes place through a binary interface similar to that used for sending push notifications. You access the production feedback service via feedback.push.apple.com, port 2196; you access the sandbox feedback service via feedback.sandbox.push.apple.com, port 2196. As with the binary interface for push notifications, you must use TLS (or SSL) to establish a secured communications channel. The SSL certificate required for these connections is the same one that is provisioned for sending notifications. To establish a trusted provider identity, you should present this certificate to APNs at connection time using peer-to-peer authentication.

一定要结帐- Issues with Feedback Service

关于ios - 即使在应用程序被删除 iPhone 后仍收到推​​送通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11535548/

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