即使在应用程序被删除后也能收到推送通知 iPhone [英] Receiving push notification even after the app is deleted iPhone

查看:107
本文介绍了即使在应用程序被删除后也能收到推送通知 iPhone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I implemented push notification in my app.

一切正常.

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

Now the problem is even after i deleted my app from device it is getting the push notifications.

当应用从设备中删除时,有什么方法可以从推送通知中取消注册该应用.

So is there any way to unregister the app from push notification when it is deleted from the device.

希望得到您的帮助.

提前致谢.

推荐答案

在 Apple 推送通知中有一种叫做 - 反馈服务的东西.因此,当用户删除应用程序时,服务提供商最好停止向该设备发送通知.但是苹果并没有通知服务这个设备没有使用你的应用程序,不要发送通知".因此,您需要轮询此信息.

In Apple push notification there is something called - Feedback Service. So when a user deletes an app, the service provider should ideally stop sending notifications to that device. But Apple does not notify the service that "this device is not using your app, dont send notifications". So instead you need to poll for this info.

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

Every day you might need to hit Apple Notification servers asking it to give you device Ids who have deleted your app. Once you get them you mark them in your DB as deleted thereby not sending any more notifications. Hope this is what you wanted.

来自 Apple 文档 -

... Apple Push Notification Service 包含反馈APNs 使用每个应用程序列表不断更新的服务尝试传送失败的设备.这些设备是由以二进制格式编码的设备令牌标识.供应商应定期查询反馈服务以获取设备列表其应用程序的令牌,每个令牌都由其标识话题.然后,在验证应用程序最近没有被在已识别的设备上重新注册,提供商应停止向这些设备发送通知.

... 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.

通过二进制接口访问反馈服务类似于用于发送推送通知.您访问生产反馈服务通过feedback.push.apple.com,端口2196;您可以通过以下方式访问沙箱反馈服务Feedback.sandbox.push.apple.com,端口 2196.与二进制文件一样推送通知的接口,您必须使用 TLS(或 SSL)来建立安全的通信渠道.SSL证书这些连接所需的连接与为其提供的连接相同发送通知.要建立可信的提供者身份,您应在连接时使用此证书向 APNs 提供点对点身份验证.

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.

请务必查看 - 反馈服务问题

这篇关于即使在应用程序被删除后也能收到推送通知 iPhone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆