3

I was reading the Google Developers documentation, and I was not able to find how to let GCM (Google Cloud Messaging) know to which device we want to send the message.

I am working on an application in which I'll be saving users' email addresses in my database. A user can invite another user to his group by specifying his email address. As soon as he enters the address of the person he wants to invite and presses submit, the request will go to GCM, which will notify the other user.

But how do I let GCM know to which mobile you have to send this notification?

Darshan Rivka Whittle
  • 32,989
  • 7
  • 91
  • 109
Mj1992
  • 3,404
  • 13
  • 63
  • 102

1 Answers1

3

basically when the device registers with the GCM server it returns a Registration ID, that registration ID should then be sent to your server for storage and that registration ID is how you send messages to specific devices whenever you need to

tyczj
  • 71,600
  • 54
  • 194
  • 296
  • so you mean that when i will get the registration id in the android phone from the gcm server.I'll save that registrationId against that user in the database and when i send the message from server to gcm server.I will specify the registrationId's to which i want to send the message. Am i right ? – Mj1992 Jul 03 '12 at 18:32