I am utilizing the apple push notification service in my application. I know that the device token sent from Apple server is unique for a device. If I uninstall my app and install it again register for push service,will this device token remain the same for that device for the same app? How does Apple generate a device token for a device?
-
Produce some code and try it. – GoZoner May 30 '13 at 03:57
-
Relevant: https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/RemoteNotificationsPG.pdf – Gabriele Petronella May 30 '13 at 03:58
-
this may help you http://stackoverflow.com/q/14563097/1868660 – Subodh Ghulaxe Jun 06 '13 at 11:27
2 Answers
Quoted from Apples Local and Push Notification Programming Guide
By requesting the device token and passing it to the provider every time your application launches, you help to ensure that the provider has the current token for the device. If a user restores a backup to a device other than the one that the backup was created for (for example, the user migrates data to a new device), he or she must launch the application at least once for it to receive notifications again. If the user restores backup data to a new device or reinstalls the operating system, the device token changes. Moreover, never cache a device token and give that to your provider; always get the token from the system whenever you need it

- 6,450
- 1
- 22
- 35
Okay, First, if you uninstall and reinstall your app that device token won't be changed. Device token only changed from you reinstall Device iOS and register your device ( reset for all new ). So, when users just reinstall the app, that device token won't be changed. This's my experience.

- 143
- 2
- 9
-
-
No, update won't change the device token except we reinstall OS to be new-born or reset iphone, the token will be changed. – Kuo Ming Lin Dec 14 '14 at 16:16
-
In iOS9 push tokens are generated each time you un-install and re-install the app. The push permissions dialog also shows up each install. This was apples move to curb using the push token by marketers to identify the user across app installs. – Kris Subramanian Oct 26 '15 at 21:48