I am using the JAXL library to connect to google gcm ccs server. I am receiving the upstream messages sent by the application. I have a problem parsing the file. The receive message callback( 'on_normal_message' ) gives the XMPPStanza object to callback. I need to parse this object to get the actual message sent by the mobile app. The below is my XMPPStanza.
XMPPStanza Object
(
[xml:XMPPStanza:private] => JAXLXml Object
(
[name] => message
[ns] => jabber:client
[attrs] => Array
(
[to] =>
I...@gcm.googleapis.com [from] =>
dev...@gcm.googleapis.com [type] => normal
)
[text] =>
[childrens] => Array
(
[0] => JAXLXml Object
(
[name] => gcm
[ns] => google:mobile:data
[attrs] => Array
(
)
[text] => {
"category":"
com.google.android.gcm.demo.app","
data":{"my_message":"Hello World","my_action":"com.google.android.gcm.demo.app.ECHO_NOW"},
"message_id":"2",
"from":"GCMID"
}
[childrens] => Array
(
)
[parent] => JAXLXml Object
*RECURSION*
[rover] => JAXLXml Object
*RECURSION*
)
)
[parent] =>
[rover] => JAXLXml Object
*RECURSION*
)
)
The data that is required by me is in [childrens]. Its an array of JAXLXml objects. How do i get the [text] of this children. This is actually a json string. I am not able to json_decode this string because of the """. How do I get this data easily ? I have to create a ack message to send to the ccs server after receiving the messages. I need from, message_id fileds in the original message.
Thanks,
abbiya