Flowchart of messages in GCM using the upstream messaging

328 views Asked by At

I am trying to understand the concept of gcm upstream messaging. Well what I came to know till now after browsing for hours is this :

1)My client app sends upstream message to gcm server.2)GCM server then sends it to my 3rd party app server.3rd party app server responds to it my sending ACK to GCM server.3)Then GCM server echoes the message to the recipient device(recipient Id is included in the upstream message sent from the app).

I don't if its what actually happens. Now that I am sure that in some step GCM server sends mesaage to my server, how actually GCM server sends message to my app server. How does it come to know about my app server as there is nowhere where we put my server's address

I have searched the whole Internet but couldn't find anything about this.I have gone through several SO questions but I couldnot find my answer.

I want to know the entire series of steps what happens during this entire process. I am very confused.I want to know the entire concept and what's going on behind all this.

Any detailed explanation with all steps will be appreciated. To inform I have read the Google docs.

1

There are 1 answers

0
Arthur Thompson On BEST ANSWER

You have much of the flow correct but I think another read of the Docs will clear things up.

Your application server must act as an XMPP client, and connect to CCS (GCM's XMPP server). Your server connecting to CCS is how GCM knows the "address" of your server.

Cleaning up the flow you suggested:

  1. Your app server connects to GCM's CCS.
  2. Your client app (android app) gets a registration token.
  3. Your client app (android app) sends that token to your app server.
  4. Your client app send upstream message to GCM.
  5. GCM fwds that message to your application server.
  6. Your application server send Ack to CCS.
  7. Your application server handles the received message.

Note the above flow is a possible one, there are many others, also downstream messages are not part of the flow. Again refer to the docs for more details.