0

When working with push notifications via the Apple's APN service, when my app is installed and the user opts into receiving push notifications a device token is generated.

Is this device token unique to every single device or is there a global device token I can use to send push notification messages?

I am guessing if the device token is unique, I would have to save it up to a DB.

ketaki Damale
  • 634
  • 7
  • 25
  • It is unique for your app on that device. – Paulw11 May 02 '18 at 10:53
  • check this answers https://stackoverflow.com/questions/6652242/does-the-apns-device-token-ever-change-once-created and https://stackoverflow.com/questions/40169404/does-a-ios-push-notification-device-token-change/40169657 – Reinier Melian May 02 '18 at 10:57
  • Thanks Ketaki, Paulw11 and Reinier. :) *Thumbs Up* – Byron Wright May 02 '18 at 11:45
  • 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. – Vinaykrishnan May 02 '18 at 12:40

1 Answers1

1

Well, Device token is unique but it become change when you reinstall it from appstore. You have to store that Token in database to send notification through that token. It should automatically register in database after installing with first time opening the app, It always hit but your database code should not reinsert it if same device token string found in the database.

NOTE: Device Token, UDID and UUID all are different and unique with some different usage purposes.

LinusGeffarth
  • 27,197
  • 29
  • 120
  • 174
Abhishek Mitra
  • 3,335
  • 4
  • 25
  • 46