GCM/APNS How are registration IDs generated
apple-push-notifications, google-cloud-messaging, push-notification
Solution
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.
Problem
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?