Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GCM/APNS How are registration IDs generated

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?

like image 952
debao84 Avatar asked Jul 16 '12 12:07

debao84


People also ask

What is GCM registration ID?

A Registration ID is an identifier assigned by GCM to a single instance of a single application installed on an Android device. The device is assigned this identifier when it registers to Google Cloud Messaging. The GCM documentation doesn't specify what information is encoded in this identifier.

What is APNs and how it works?

APNS is a cloud-based service that enables apps to send push notifications from a remote server to iOS users through a secure connection. Before iOS users receive your messages, you'll need a p. 12 certificate from Apple, which authorizes push sending through APNS.

What is GCM and APNs?

From this thread, GCM is a service that helps developers send data from servers to their Android applications on Android devices. Same with APN which is a service for app developers to propagate information to iOS (and, indirectly, watchOS), tvOS, and macOS devices.

Are APNs paid?

APNS is a free service. However, you need to maintain a server to send Push Messages.


1 Answers

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.

like image 74
Srikanth Avatar answered Sep 28 '22 03:09

Srikanth