Question

I am new to android development,I am working on push notification app now and trying to get overview of concepts of how GCM works for both server side and client side

i am stuck with one of the concepts given in the Flow Control on the google android developer website.

http://developer.android.com/google/gcm/ccs.html#flow

they have given something like this:

Every message sent to CCS receives either an ACK or a NACK response. Messages that haven't received one of these responses are considered pending. If the pending message count reaches 1000, the 3rd-party app server should stop sending new messages and wait for CCS to acknowledge some of the existing pending messages .

Conversely, to avoid overloading the 3rd-party app server, CCS will stop sending if there are too many unacknowledged messages. Therefore, the 3rd-party app server should "ACK" upstream messages, received from the client application via CCS, as soon as possible to maintain a constant flow of incoming messages. The aforementioned pending message limit doesn't apply to these ACKs. Even if the pending message count reaches 1000, the 3rd-party app server should continue sending ACKs for messages received from CCS to avoid blocking delivery of new upstream messages.

ACKs are only valid within the context of one connection. If the connection is closed before a message can be ACKed, the 3rd-party app server should wait for CCS to resend the upstream message before ACKing it again. Similarly, all pending messages for which an ACK/NACK was not received from CCS before the connection was closed should be sent again.

My questions are

1 >> is this a flow between 3rd party app server and gcm server?

2 >> Why 3rd party server can send only 1000 requests and what happens if more requests are made?

3 >> when would gcm send ACK and NACK? In the sense, when a request is made to a 3rd party server to gcm , gcm checks for if device is registered or not (throw registration id) or does it confirm the delivery of message to registered id'ed device and then send ACK to 3rd party server?

4 >>when does server get NACK ? In the sense, in what case scenario it will receive NACK ?

Thanks in Advance!

Was it helpful?

Solution

In order:

  1. Yes (more precisely, it is a flow between CCS and 3rd party over XMPP)

  2. 1000 is the threshold to avoid CCS flood. This a rate limit, the number of messages is not limited (and free ...).

  3. Every time you send a valid request (message to device), a ACK indicates it will be send. NACK warns you about and error in your request.

  4. see just above.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top