即使在iPhone删除应用程序后也会收到推送通知

时间:2022-08-26 22:05:04

I implemented push notification in my app.

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

It is working fine.

它工作正常。

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.

因此,有什么方法可以在从设备中删除应用程序时从推送通知中取消注册该应用程序。

Hoping for your help.

希望得到你的帮助。

Thanks in advance.

提前致谢。

3 个解决方案

#1


9  

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推送通知中,有一种称为 - 反馈服务。因此,当用户删除应用程序时,服务提供商应该理想地停止向该设备发送通知。但Apple没有通知服务“此设备未使用您的应用程序,请勿发送通知”。因此,您需要轮询此信息。

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 Notification服务器,要求它为您提供已删除应用程序的设备ID。获得它们后,在数据库中将它们标记为已删除,从而不再发送任何通知。希望这是你想要的。

From Apple Documentation -

来自Apple文档 -

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

... Apple推送通知服务包括一个反馈服务,APN不断更新每个应用程序的设备列表,其中有失败的传递尝试。设备由以二进制格式编码的设备令牌识别。提供者应定期查询反馈服务,以获取其应用程序的设备令牌列表,每个令牌都由其主题标识。然后,在验证应用程序最近未在已识别的设备上重新注册后,提供商应停止向这些设备发送通知。

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.

通过类似于用于发送推送通知的二进制接口来访问反馈服务。您可以通过feedback.push.apple.com,端口2196访问生产反馈服务;您可以通过feedback.sandbox.push.apple.com,端口2196访问沙箱反馈服务。与推送通知的二进制接口一样,您必须使用TLS(或SSL)建立安全的通信通道。这些连接所需的SSL证书与为发送通知而配置的证书相同。要建立可信的提供者身份,您应该在连接时使用对等身份验证将此证书提供给APN。

Be sure to checkout - Issues with Feedback Service

一定要结帐 - 反馈服务问题

#2


0  

Go to Settings, under Notifications, and disable all and any notifications for the offending app. Not a permanent solution as you still have to find out and solve the root of the problem

转到“通知”下的“设置”,然后停用违规应用的所有通知和任何通知。不是永久解决方案,因为您仍然需要找出并解决问题的根源

#3


0  

Having not seen this answer so far, there is a small note in the Apple "Troubleshooting Push Notifications" document.
In short, if you delete the last push enabled app, the persistent connection from the device to Apples push server is broken before the server is told that the app has been deleted.
Solution: keep at least one push enabled app on your device.

到目前为止还没有看到这个答案,Apple“故障排除推送通知”文档中有一个小注释。简而言之,如果删除最后一个推送启用的应用程序,则在服务器被告知应用程序已被删除之前,从设备到Apples推送服务器的持久连接已断开。解决方案:在您的设备上至少保留一个支持推送的应用。

There is the explanation from the document:

文件中有解释:

Issues with Using the Feedback Service If you remove your app from your device or computer and then send a push notification to it, you would expect to have the device token rejected, and the invalidated device token should appear on the feedback service. However, if this was the last push-enabled app on the device or computer, it will not show up in the feedback service. This is because deleting the last app tears down the persistent connection to the push service before the notice of the deletion can be sent.

使用反馈服务的问题如果从设备或计算机中删除应用程序,然后向其发送推送通知,则可能会拒绝设备令牌,并且反馈服务上应显示无效的设备令牌。但是,如果这是设备或计算机上最后一个支持推送的应用程序,它将不会显示在反馈服务中。这是因为删除最后一个应用程序会删除与推送服务的持久连接,然后才能发送删除通知。

You can work around this by leaving at least one push-enabled app on the device or computer in order to keep the persistent connection up. To keep the persistent connection to the production environment up, just install any free push-enabled app from the App Store and you should then be able to delete your app and see it appear in the feedback service.

您可以通过在设备或计算机上保留至少一个支持推送的应用程序来解决此问题,以便保持持久连接。要保持与生产环境的持久连接,只需从App Store安装任何免费的支持推送的应用程序,然后您就应该能够删除您的应用并将其显示在反馈服务中。

Recall that each push environment has its own persistent connection. So to keep the persistent connection to the sandbox environment up, install another development push-enabled app."

回想一下,每个推送环境都有自己的持久连接。因此,要保持与沙盒环境的持久连接,请安装另一个支持开发推送的应用程序。“

#1


9  

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推送通知中,有一种称为 - 反馈服务。因此,当用户删除应用程序时,服务提供商应该理想地停止向该设备发送通知。但Apple没有通知服务“此设备未使用您的应用程序,请勿发送通知”。因此,您需要轮询此信息。

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 Notification服务器,要求它为您提供已删除应用程序的设备ID。获得它们后,在数据库中将它们标记为已删除,从而不再发送任何通知。希望这是你想要的。

From Apple Documentation -

来自Apple文档 -

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

... Apple推送通知服务包括一个反馈服务,APN不断更新每个应用程序的设备列表,其中有失败的传递尝试。设备由以二进制格式编码的设备令牌识别。提供者应定期查询反馈服务,以获取其应用程序的设备令牌列表,每个令牌都由其主题标识。然后,在验证应用程序最近未在已识别的设备上重新注册后,提供商应停止向这些设备发送通知。

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.

通过类似于用于发送推送通知的二进制接口来访问反馈服务。您可以通过feedback.push.apple.com,端口2196访问生产反馈服务;您可以通过feedback.sandbox.push.apple.com,端口2196访问沙箱反馈服务。与推送通知的二进制接口一样,您必须使用TLS(或SSL)建立安全的通信通道。这些连接所需的SSL证书与为发送通知而配置的证书相同。要建立可信的提供者身份,您应该在连接时使用对等身份验证将此证书提供给APN。

Be sure to checkout - Issues with Feedback Service

一定要结帐 - 反馈服务问题

#2


0  

Go to Settings, under Notifications, and disable all and any notifications for the offending app. Not a permanent solution as you still have to find out and solve the root of the problem

转到“通知”下的“设置”,然后停用违规应用的所有通知和任何通知。不是永久解决方案,因为您仍然需要找出并解决问题的根源

#3


0  

Having not seen this answer so far, there is a small note in the Apple "Troubleshooting Push Notifications" document.
In short, if you delete the last push enabled app, the persistent connection from the device to Apples push server is broken before the server is told that the app has been deleted.
Solution: keep at least one push enabled app on your device.

到目前为止还没有看到这个答案,Apple“故障排除推送通知”文档中有一个小注释。简而言之,如果删除最后一个推送启用的应用程序,则在服务器被告知应用程序已被删除之前,从设备到Apples推送服务器的持久连接已断开。解决方案:在您的设备上至少保留一个支持推送的应用。

There is the explanation from the document:

文件中有解释:

Issues with Using the Feedback Service If you remove your app from your device or computer and then send a push notification to it, you would expect to have the device token rejected, and the invalidated device token should appear on the feedback service. However, if this was the last push-enabled app on the device or computer, it will not show up in the feedback service. This is because deleting the last app tears down the persistent connection to the push service before the notice of the deletion can be sent.

使用反馈服务的问题如果从设备或计算机中删除应用程序,然后向其发送推送通知,则可能会拒绝设备令牌,并且反馈服务上应显示无效的设备令牌。但是,如果这是设备或计算机上最后一个支持推送的应用程序,它将不会显示在反馈服务中。这是因为删除最后一个应用程序会删除与推送服务的持久连接,然后才能发送删除通知。

You can work around this by leaving at least one push-enabled app on the device or computer in order to keep the persistent connection up. To keep the persistent connection to the production environment up, just install any free push-enabled app from the App Store and you should then be able to delete your app and see it appear in the feedback service.

您可以通过在设备或计算机上保留至少一个支持推送的应用程序来解决此问题,以便保持持久连接。要保持与生产环境的持久连接,只需从App Store安装任何免费的支持推送的应用程序,然后您就应该能够删除您的应用并将其显示在反馈服务中。

Recall that each push environment has its own persistent connection. So to keep the persistent connection to the sandbox environment up, install another development push-enabled app."

回想一下,每个推送环境都有自己的持久连接。因此,要保持与沙盒环境的持久连接,请安装另一个支持开发推送的应用程序。“