iOS 7 Device Token Is Different for Same Device

ios 7 device token is different for same device

This one was also helpful.Please see point 1 in this article:
https://support.urbanairship.com/customer/portal/articles/1321513-how-ios-7-handles-push-differently

"Prior to iOS 7, the device token was the same across all app installations on a given device. Different apps on your phone, whether Tap Tap Revenge or USA Today, would utilize the same address, i.e., device token, to route the push notification to you. The security credentials that you pair with a message would ensure it made it to the right app. On iOS 7, Apple has gone one step further and made sure that device tokens are now different in every single app install. This helps further protect users’ privacy by removing another phone-level identifier."

Is device token is same for all app in Android?

No, Google Cloud Messaging device tokens (or more accurate Registration IDs or Registration Tokens) are different for each app on the same device.

BTW, even though I haven't tested it myself, I read that iOS device tokens are also different for each app on the same device starting in iOS7.

Does every apps in iOS has the same deviceToken?

Each app has different device token.

A device token is an identifier for the Apple Push Notification System for iOS devices. Apple assigns a Device Token on a per-app basis (iOS 7 and later) which is used as a unique identifier for sending push notifications. Each device has two device tokens per app: one for development, and one for production (ad hoc or app store builds). The tokens are 64 hexadecimal characters.

Same APNS token returned by two different applications

All apps on the same device get the same device token. Apple knows which app should receive the notification because the certificate you use to send the notification is unique for each app.

Obtain NEW Apple device token?

No, you can't request a new device token. They expire from time to time, and only then will you get a new one (or if you have a different app with a different bundle id, the token will be different).

Create a function to handle didRegister and call that from didRegisterForRemoteNotificationsWithDeviceToken. Then use that function when you need to force the call.

Since users are logging in, pass the information with the device token to the server every time someone logs in and associate the user to the token on the server side.

Are push notification tokens unique across all apps for a single device?

Device tokens are not exactly unique per device; they're unique per operating system installation. So if a user buys a new device but does not restore from backup, then they'll get a new device token. And if a device is wiped, it will get a new device token, so the new user doesn't get the old user's messages.

In addition, there are different tokens returned for development apps using the sandbox and distribution apps using the production system.

Since a single user might have your app installed on multiple devices legally (iPhone and iPad, for instance), it will be much safer to have a many to many relationship between users and device tokens, to be on the safe side.

And since you mentioned Urban Airship, you might find that our alias feature helps for this sort of thing; you can assign a non-unique alias to the different tokens in our end, and then we'll keep track of the mapping between your users and their device tokens. See the registration and push parts of the UA documentation.

Edit: An update because I saw some more upvotes on this old answer. As of iOS 7, device tokens are unique for each application, even on the same device.



Related Topics



Leave a reply



Submit