GCM: using the same account on multiple devices - what's going on?

I have a question regarding google cloud messaging.

When I install the same app on two different google android devices with the same google account, then both will register with gcm. I store their regId on the server.

but what happens when I send a message to one of the regid messages - the second gets the message? - will one of the rules be canonical? (due to the same google account on the device as the other, or are they handled completely differently?)

+3


source to share


2 answers


What happens when I send a message to one of the register - will the second message receive?

Oh no. This is because GCM not only only takes into account the Google account you use on your phone, but it also identifies the specific device and the specific app you use on it. The GCM ID is unique for any given application on any given device. Thus, the cloud determines which device to insert notifications to. Therefore, even if you log into two different devices with the same account, both will register with different keys. You use this key to identify an individual device / application.



Go to the official documentation for full details.

+3


source


It sounds like you want to use User Notifications . The docs are pretty simple. Basically you will need to do some server side work to map multiple registration IDs to a single "notification_key", after which you use that key when clicking on Google.



Google handles taps across multiple devices and will even do something nice for you.

0


source







All Articles