iOS push notifications behavior when app is deleted and then reinstalled

前端 未结 2 379
暗喜
暗喜 2020-12-24 02:26

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:

相关标签:
2条回答
  • 2020-12-24 03:00

    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.

    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.

    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.

    0 讨论(0)
  • 2020-12-24 03:11

    When you delete the app, the OS doesn't "de-register" it from APNS. You have to send a notification to a device that has deleted the app in order to "de-register" it. This may take a few tries from APNS until it figures out the app has been deleted.

    0 讨论(0)
提交回复
热议问题