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

标签 ios objective-c push-notification apple-push-notifications

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

它工作正常。

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

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

希望得到您的帮助。

提前致谢。

最佳答案

在 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/

相关文章:

ios - 使用一个数据库处理两个 MVC 之间的托管对象

ios - 如何保存通过 AVCaptureSession 拍摄的图像

.net - Azure 通知中心注册生存时间

ios - Parse Push Notifications 可以针对特定的 iOS 吗?

android - 即使手机被锁定,如何每 x 分钟发送一次通知

ios - 在 iOS 7 的横向模式下将 UIAlertView 稍微向下移动

ios - 使计时器无效并创建新实例

iOS Objective-C 在 VoiceOver 处于事件状态时关闭接近监控

objective-c - enumerateObjectsUsingBlock : used for? 的 BOOL *stop 参数是什么

ios - 调用 sqlite3_column_type 返回 SQLITE_INTEGER 用于仅包含导致整数溢出的数字的 STRING 列