Search code examples
androidpush-notificationxmppreal-timegoogle-cloud-messaging

Client(android application) acks for sent gcm messages


Can the android app get the acknowledgements for the sent gcm messages via googleclougmessaging.send() to ccs servers ? How can the client be sure about the delivery of the message to the ccs server ?


Solution

  • According to the Cloud Connection Server docs, the only acknowledgment when sending a message from device to cloud is the acknowledgment expected by the Cloud Connection Server from your server. It only tells CCS that your server got the message, but CCS doesn't pass that acknowledgment to the device.

    Here is the format of the ACK expected by CCS from 3rd-party app servers in response to the above message:

    <message id="">
      <gcm xmlns="google:mobile:data">
          {
              "to":"REGID",
              "message_id":"m-123"
              "message_type":"ack"
          } 
      </gcm>
    </message>
    

    Of course, your server can send a message back to the device as a response to the message it got from the device, and that message can serve as an acknowledgment.