2

We have a push notification server which holds the data (device tokens) for several different applications. With Apple wanting to stop people using the UDID as identifier, I was looking into changing this server so that it does not rely on UDIDs to identify devices any longer.

I understand that the tokens returned by APNs are not globally unique, but rather unique per device. However, when going through our database, I noticed that there are several cases (a few hundred on 750k+ registrations) where the same token is used for different devices.

So I'm trying to figure out what's causing this. At this point, I see 2 possibilities:

  1. There is an obscure bug in our server registration handling somewhere
  2. Apple recycles these device tokens (perhaps after a device reset?). We always store the last time a certain device registered, and I noticed that there are always at least several days between registrations of different devices with the same token. As far as I can tell, there are no tokens that are concurrently used by different devices.

I would really appreciate it if someone could shed some light on this.

Mopper
  • 1,677
  • 2
  • 18
  • 41

1 Answers1

4

What we know is that Apple tells us to use the Device Token to push notifications to a device. So, as long as you are:

  1. Querying the APNs for a new device token every time the application is launching and registering it in your database

  2. Querying the Feedback service for inactive devices and purging them from your database

... you are doing what Apple is expecting you to do.

However, I do suspect that there may be a bug in your registration code because 100/750k is a pretty high conflict rate. Considering these device tokens are used to push notifications, a lot of people would be complaining about receiving notifications that don't belong to them...

achan
  • 551
  • 2
  • 11
  • 1
    I forgot I had this question open, but yes, we had a bug in our registration handling. – Mopper Oct 23 '12 at 20:20
  • Hi @Mopper ... curious to know what kind of bug that was that would cause multiple users to get the same device token. I ask because we're seeing something similar right, and it would be useful to know what to look for in our system :) – Joel Martinez Jul 19 '13 at 15:44
  • @JoelMartinez Like I said in my first comment on this answer, our problem turned out to be a bug in our device registration code. In the meantime, however, there has been a bug in iOS 6.0 which may cause you to receive duplicate device IDs. It is explained [here](http://stackoverflow.com/questions/12605257/the-advertisingidentifier-and-identifierforvendor-return-00000000-0000-0000-000) – Mopper Jul 23 '13 at 09:37