iOS的推送通知的行为,当应用程序被删除,然后重新安装 [英] iOS push notifications behavior when app is deleted and then reinstalled

查看:708
本文介绍了iOS的推送通知的行为,当应用程序被删除,然后重新安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到其中一个用户正在继续收到通知时,我的应用程序已被删除,然后重新安装一个不寻常的场景。的情况如下:

I've encountered an unusual scenario where a user is continuing to receive notifications when my app has been deleted and then reinstalled. The scenario is as follows:


  • 从用户在AppStore
  • 安装应用
  • 用户登录到我们的应用程序,我们注册它们的通知

  • 用户从他们的设备
  • 删除应用程序
  • 从用户在AppStore
  • 重新安装应用程序
  • 用户接收,即使他们还没有开始应用了没有通知,登录等

  • user installs the app from the appstore
  • user logs onto our app and we register them for notifications
  • user deletes the app from their device
  • user reinstalls the app from the appstore
  • user receives a notification even though they have not started the app up yet, logged in, etc

我对的APN架构的理解是,一旦你的应用程序从设备中删除,它是从的APN由操作系统本身取消注册。该应用程序的重新安装的不会重新启用通知,直到你被称为registerForRemoteNotificationTypes - 所以,如果一个音符是使用旧的令牌发送到设备,的APN不会提供它,因为上面的方法还没有被调用。

My understanding of the APNs architecture was that once your app is deleted from your device, it is de-registered from APNs by the OS itself. A reinstall of the app would not re-enable notifications until you called "registerForRemoteNotificationTypes" -- so if a note was sent to the device using the old token, APNs would not deliver it since the above method has not been called.

那是不准确的?

推荐答案

令牌保持不变。它甚至在设备上的所有应用程序相同。只有当你改变操作系统版本变化。然而,这仍然没有解释你遇到了奇怪的行为。

The token remains the same. It's even the same for all applications on the device. It only changes when you change the OS version. However, that still doesn't explain the strange behavior you encountered.

我相信苹果标识应用程序已经从设备卸载(当你发送通知到应用程序的特定设备上的设备卸载后,通常发生)后,才未注册的应用程序。
如果没有通知被发送到该卸载卸载的时间和新安装的时间之间的应用程序在设备上的应用程序,苹果不知道卸载该应用的设备,因此它仍然是注册APNS。

I believe that only after Apple identifies that the application has been uninstalled from the device (which usually happens when you send a notification to the app on a specific device after the device uninstalled it) it un-registers the app. If no notifications were sent to the app on the device that uninstalled the app between the time of uninstall and the time of the new installation, Apple don't know the device uninstalled the app, and therefore it is still registered for APNS.

反馈服务的行为支持我的理论 - 如果卸载应用程序并调用反馈服务,你不会得到卸载该应用的设备的设备令牌。您尝试将通知发送到该设备后,才,苹果将检测卸载,并在反馈服务返回的设备令牌。

The behavior of the feedback service supports my theory - if you uninstall the app and call the feedback service, you won't get the device token of the device that uninstalled the app. Only after you try to send a notification to that device, Apple will detect the uninstall and return that device token in the feedback service.

我要补充的最后一件事 - 如果卸载的应用程序是已注册的推送通知设备上的最后一个,在APN服务将永远不会知道,应用程序卸载,因此它仍然会后进行注册APN被重新安装。

One last thing I should add - if the uninstalled app is the last one on the device that was registered for push notifications, the APN service will never know that the app was uninstalled, and therefore it will still be registered for APN after being re-installed.

这篇关于iOS的推送通知的行为,当应用程序被删除,然后重新安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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