Shivam Bhusri
Shivam Bhusri

Reputation: 1171

How to parse JAXLxml stanza in PHP?

Sir,I am trying to make chat app using firebase cloud messaging and stuck at parsing respone from XMPP server.Here Is the response I am getting:

jabber:clientXMPPStanza Object ( [xml:XMPPStanza:private] => JAXLXml Object  ( [name] => message [ns] => jabber:client [attrs] => Array ( [type] => normal ) [text] => [childrens] => Array ( [0] => JAXLXml Object ( [name] => gcm [ns] => google:mobile:data [attrs] => Array ( ) [text] => {"message_type":"ack","from":"REGID","message_id":"123"} [childrens] => Array ( ) [parent] => JAXLXml Object *RECURSION* [rover] => JAXLXml Object *RECURSION* ) ) [parent] => [rover] => JAXLXml Object *RECURSION* ) ) jabber:clientXMPPStanza Object ( [xml:XMPPStanza:private] => JAXLXml Object ( [name] => message [ns] => jabber:client [attrs] => Array ( [to] => <SENDERID>@gcm.googleapis.com [from] => [email protected] [type] => normal ) [text] => [childrens] => Array ( [0] => JAXLXml Object ( [name] => gcm [ns] => google:mobile:data [attrs] => Array ( ) [text] => {"data":{"my_action":"SAY_HELLO","my_message":"Hello World"},"time_to_live":0,"from":"REGID","message_id":"20","category":"package name"} [childrens] => Array ( ) [parent] => JAXLXml Object *RECURSION* [rover] => JAXLXml Object *RECURSION* ) ) [parent] => [rover] => JAXLXml Object *RECURSION* ) )

I had already read all the jaxl docs but could not found anything healthy.please suggest any way to get message and REGID.Thanks in advance.

Upvotes: 2

Views: 91

Answers (0)

Related Questions