客户端(Android应用程序)的ACK已发送邮件GCM [英] Client(android application) acks for sent gcm messages
问题描述
Android应用程序能获得通过googleclougmessaging.send()发送GCM消息CCS服务器的确认?客户端怎么能肯定在传递消息到CCS服务器?
据云连接服务器的文档,从设备将消息发送到云时,只承认是从服务器的云连接服务器预期的确认。它只是告诉CCS您的服务器得到的消息,但CCS不承认这传递给设备。
下面是来自第三方的应用CCS预计ACK的格式
响应于上述消息服务器<消息ID =>
< GCM的xmlns =谷歌:手机:数据>
{
到:REGID,
与Message_ID:M-123
message_type:应答
}
< / GCM>
< /消息>
块引用>当然,服务器可以发送一个消息给设备以将其从设备得到的消息的响应,并且该消息可以作为确认
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.
这篇关于客户端(Android应用程序)的ACK已发送邮件GCM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!