MasterSquirrel
MasterSquirrel

Reputation: 89

GCM: registration id or token

For Google cloud messaging, is there a use for storing the token? Or can we just work with the registration id? Trying to setup push notifications and was wondering why they use both tokens and registration ids.

Upvotes: 0

Views: 435

Answers (2)

MasterSquirrel
MasterSquirrel

Reputation: 89

Use the token on your server, to specify the device you want to send a message to. You, as a developer, have no significant use for the registrationID, in terms of actually sending the message.

Upvotes: 1

Tony Vu
Tony Vu

Reputation: 4371

From my understanding, token is used to authorize your application' access to Google Service while registration id is the unique identifier of an app on a specific device. GCM uses Registration ID to identify the device and app to send push notification to. So to answer your question, you need both of them.

Upvotes: 0

Related Questions