GCM/APNS How are registration IDs generated

10,216

Solution 1

APNS:

  1. If I understand their docs correctly, deviceToken is unique to device.
  2. It is requested by iOS (or Mac OSX >10.7) when an app makes a request to register itself with APNS.
  3. deviceToken is basically an encrypted deviceID and possibly some other info (not specific to app).
  4. 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:

  1. It is generated per device per application.
  2. GCM may periodically refresh registration id.
  3. Uninstalling and re-installing almost always gives a different registration id.
  4. 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.

Share:
10,216
debao84
Author by

debao84

Updated on August 21, 2022

Comments

  • debao84
    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?