gcm
gcm copied to clipboard
XMPP lib cannot handle stanza error responses
When we get following in response to a message with broken stanza (as described here: https://developer.android.com/google/gcm/ccs.html#stanza):
<message id="3" type="error" to="[email protected]/ABC">
<gcm xmlns="google:mobile:data">
{"random": "text"}
</gcm>
<error code="400" type="modify">
<bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
<text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">
InvalidJson: JSON_PARSING_ERROR : Missing Required Field: message_id\n
</text>
</error>
</message>
The resulting output is:
&{XMLName:{Space:jabber:client Local:message} From: ID: To:[email protected]/... Type:error Subject: Body: Thread: Other:[ ]}
We should instead get our broken request:
<gcm xmlns="google:mobile:data">
{"random": "text"}
</gcm>
and the error details back in Other:[]
array.