Gwowen
Gwowen

Reputation: 178

Google Cloud Messaging - Does Android client have to send registration token to my application server?

I am new to GCM and not clear about the registration process between client and the app server. Since GCM upstream messaging is available, when client registers with GCM, is it possible that GCM can send the registration data to app server, so the android client doesn't have to send the registration token/id to app server like the old day?

I saw a push notification diagram somewhere that shows no connection between app server and the client. All the communication can be passed through GCM.

Thanks!

Upvotes: 0

Views: 221

Answers (3)

Basu
Basu

Reputation: 763

If you have seen the registration diagram then you may notice that your app connects with GCM server to obtain a key. So basically your app acquires a token ID. That means your app needs to send this id to your server and not GCM server.

Then you can simply send Push Notification to a Single user, Groups of User, or to an Topic.

Upvotes: 0

joarleymoraes
joarleymoraes

Reputation: 1949

The client has to inform the token to the app server somehow.

From the docs:

(...)
2 - The client app passes the registration token to the app server
3 - The app server saves the registration token and acknowledges to the client app that the process completed successfully

Upvotes: 0

tyczj
tyczj

Reputation: 73721

is it possible that GCM can send the registration data to app server, so the android client doesn't have to send the registration token/id to app server like the old day?

if you intend to send messages to individual devices you still have to send the reg id to your server.

if you do not need to have the ability to send to individual devices then you can have the app subscribe to topics and then all your server has to do is send a message to a topic and anyone subscribed to that topic will get the message

Upvotes: 0

Related Questions