2

I am developing the iOS app with PhoneGap. I used the PhoneGap push notification plugin to integrate push notification. So, when user start the app in my database I have recorded the user id and the notification token id. Recently I have realized that there are multiple token ID's for same user.

I'm wondering is this because of the iOS updates. (Recently they have release the several updates iOS 7.0, 7.0.1, 7.0.2 etc..)

Can anyone please confirm this? And also if this is not the case can anyone give me some idea or possible reason to change APNS token?

Thanks

user1692043
  • 43
  • 1
  • 4
  • I found this thread more relevant - http://stackoverflow.com/questions/6652242/does-the-device-token-ever-change-once-created – Gautam Jain Apr 02 '15 at 06:30

2 Answers2

3

Yes, installing a new iOS version changes the device token of the device. That was true even prior to iOS7.

In addition, I read that starting in iOS7, each application gets a unique device token for the same device (which wasn't the case for pre iOS7 versions), but for backward compatibility, the old device token still works (until you start sending messages with the new device token). That would explain your users getting duplicate messages.

You should handle the case in which the device token of a device changes. Since you already have a user ID to identify the user, you can easily make sure that you keep a single device token for each user.

Eran
  • 387,369
  • 54
  • 702
  • 768
  • This make sense. Thank you. I actually did as you say. But the problem is if some user's use two iOS device. Since iOS new app submission rule doesn't allow to access/use the UDID. https://developer.apple.com/news/index.php?id=3212013a In that case it is hard to track the different device tokens. – user1692043 Nov 18 '13 at 19:00
  • @user1692043 If you want to support users with multiple devices, I suggest that your server generate a unique device identifier for each device and that identifier should be associated with the device token in your DB. This ID should be stored on the device in external storage (to live across installations and un-installations of the app). When you receive a new device token with an existing device ID, you modify the existing device token instead of creating a new one. – Eran Nov 18 '13 at 20:09
0

Different iOS devices will have different push notification tokens. Could it be that certain users are using more than one iOS device? iPhone, iPod Touch, iPad?

Varun Mehta
  • 118
  • 6
  • Yes, Possible. But here some user's reported that they get the same notification multiple time. When I researching the database for tjos I found that those users have multiple token ID in the database. – user1692043 Nov 18 '13 at 15:46