GCM/APNS How are registration IDs generated
Solution 1
APNS:
- If I understand their docs correctly, deviceToken is unique to device.
- It is requested by iOS (or Mac OSX >10.7) when an app makes a request to register itself with APNS.
- deviceToken is basically an encrypted deviceID and possibly some other info (not specific to app).
- From this, we can easily see that all apps share deviceToken on a device and uninstalling followed by re-installation should not change deviceToken.
You can look at the official APNS docs for more information.
GCM:
- It is generated per device per application.
- GCM may periodically refresh registration id.
- Uninstalling and re-installing almost always gives a different registration id.
- Application updates may result in new registration ids being issued.
Please let me know if anyone thinks this is incorrect.
Solution 2
Have you looked through the Google GCM Architectural Overview here: http://developer.android.com/guide/google/gcm/gcm.html?
The registration_id is generated by the Google GCM server and returned to you. It's per device per app. So if you are managing 2 apps, and a device installs both of them, each app will get it's own unique registration_id.
Google GCM cannot be used for iOS, you need to go through Apple's push notification server for that. And I imagine they have the same architecture, i.e. one unique id per app per device.
debao84
Updated on August 21, 2022Comments
-
debao84 over 1 year
I am currently implementing a push notification server based on php that can manage multiple apps.
How is the registration_id for GCM generated. Is the registration id generated per device or per installation.
Example: I got 2 apps A and B.
When the device registers for A and B, do the installations have the same registration ids or is one id generated per installation.
The same question for iOS, one id per installation or device?