문제

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 ?

도움이 되었습니까?

해결책

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.

다른 팁

I face many problems with Gcm Acks, so the solution for you is to do that by yourself, it's very sample:

  1. when xmpp reciev any message you should write a function to send ack to the sender (via GCM) with any data you want. and when the sender device get that ack (lets call it ("fromxmppAck") you can deal with it as ack for everything.
  2. when the target device get any message, you should write a function to send ack to the xmpp tells that the message is received on the target device, (call it: from_target_ack)
  3. When the server get "from_target_ack" (it must contain the ID of the original sender) just pass the message to the original sender...
  4. in the original sender you should deal with this ack knowing that the message arrived to the target.

this what I did when I force problems with GCM Acks, I just ignore gcm acks and did 1. 2. 3. 4. and everything is ok

As I know from my experience gcm sends back ack to the device... the ack message type is "send event" and it contains : 1.message id 2. event.. The event faild describes the result of sending msg.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top