Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does server locate GCM (Google Cloud Messaging) registration IDs

I am trying to write an application which notifies a cellphone using GCM. I was able to implement basic functionality, but there is one question I'm still unsure of

As I understand, the flow goes like this:

  1. Device start up
  2. Device registers, obtains registration id
  3. Server gets the knowledge of registration id on device
  4. Server is using it's API key + registration id to send payload to device
  5. Device receives payload.

One thing which is unclear to me is: what is a proper methodology to implement step #3?

I could not find any way to obtain a list of registered devices. Lets imagine, I am using GCM for a purpose of posting to a known device, and I could email that ID to myself and then register it on the server manually. But as I understand, it expires.

So, it there an expectation that I have to keep re-registering and somehow notifying server every time it happens?

like image 938
galets Avatar asked Jan 28 '26 19:01

galets


1 Answers

Yes, your app on device must send registration ID to your server application in order for server to be able to send GCM messages. See third point in Enabling GCM.

like image 150
Peter Knego Avatar answered Jan 30 '26 08:01

Peter Knego



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!