3 ms·
What about push notifications? I think that's the biggest legitimate use of UDIDs and was not mentioned in the article. According to the docs, every time an iO
by epoxyhockey 15y ago
What about push notifications? I think that's the biggest legitimate use of UDIDs and was not mentioned in the article.
According to the docs, every time an iOS app starts up it sends a device token to the push provider. From time to time, this device token changes, so it is nice to have the token linked to the UDID so that one doesn't try to send push notifications to invalid device tokens.
Reference: http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html http://developer.apple.com/library/ios/#documentation/Networ...
- msftguy 15y agoIt's handled when your push service trims out dead tokens, which it needs to do periodically anyway.
- epoxyhockey 15y agoThanks for that info, I somehow overlooked this when rolling my own push provider. For those still interested: There is a separate feedback service (feedback.push.apple.com) that providers should query periodically. It returns a list of device tokens that are no longer valid for your application. Reference: http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingWIthAPS/CommunicatingWIthAPS.html#//apple_ref/doc/uid/TP40008194-CH101-SW4 http://developer.apple.com/library/ios/#documentation/Networ...
- progolferyo 15y agoHmm, while the documentation does say this, in my experience the token never changes, even across app for a given device.
- toddheasley 15y agoThe APNs token is unique to the install of iOS, not the hardware. So if a user moves to new hardware (with a different UDID), and they restore from a backup of their previous device, the token stays the same. Similarly, if a user does a complete restore of an iOS device (same UDID), but sets the existing device up as a new device, a new token is assigned. I have about a year of data from providing push to ~100K active device tokens. The former scenario, where a user upgrades to a new device and restores from a backup of their old device is really common. The latter almost never happens. So the UDID is marginally useful, in that it allows you to abstract push-enabled iOS systems from iOS devices. For doing something like user authentication, the APNs token is actually preferable, because it gets transported along with app data when a user upgrades to a new device. I'm guessing that developers use the UDID, because when you register with the system to get the APNs token, the user is prompted to accept or deny push notifications. Edit: And, yes, tokens aren't specific to an app; there's one per system that all the apps share.