Nagaraj Wadakannavar
Nagaraj Wadakannavar

Reputation: 67

GCM Registration ID

Is GCM registration ID same for all the applications installed on device or is this unique for an app?

To be more specific, I have 10 applications installed on a device and all of them support push notifications. How many registration IDs will device have? 10 or 1?

Upvotes: 0

Views: 782

Answers (3)

Benoit
Benoit

Reputation: 1167

You'll have 10. GCM generates a new token for every app you register even if it's on the same device.

Be also aware that GCM may generate a new token for your app depending on some events (app update for exemple). You may want to take a look at the documentation (the onTokenRefresh part): https://developers.google.com/cloud-messaging/android/client#sample-register

Upvotes: 1

Aswin P J
Aswin P J

Reputation: 561

From Google Developers Guide

To register with GCM:

The client app obtains a registration token using the Instance ID API. The call to this API must have the authorized entity set to your app server's sender ID, and the scope set to the appropriate value for GCM (depending on your platform)....

It is unique to each application. Has to be..if you want to send individual notifications to each of the different applications.

Upvotes: 0

Goofyahead
Goofyahead

Reputation: 5884

It will generate one GCM id for each application.

Your GCM sender key is unique per app.

Upvotes: 0

Related Questions