react-native-xmpp icon indicating copy to clipboard operation
react-native-xmpp copied to clipboard

Android: Parser is not converting all of the XML to JSON

Open MrScorp opened this issue 6 years ago • 2 comments

Android: As a response to a user search stanza, the server is returning multiple fields for the result items, but the parser is returning only the "Name" field after converting it to JSON in rnxmpp.utils.Parser. To verify, I trapped a log from the "processPacket" method in XmppServiceSmackImpl and obtained the actual XML response which is returned by the server.

Example: Actual XML returned by the server as a response to "sendStanza" :

[email protected] [email protected] johnson Johnson

JSON returned in the javascript onIQ() callback :

{ "query": { "x": { "field": { "type": "hidden", "var": "FORM_TYPE" }, "item": { "field": { "value": "Johnson", "var": "Name" } }, "reported": { "field": { "type": "text-single", "var": "Email", "label": "Email" } }, "type": "result", "xmlns": "jabber:x:data" }, "xmlns": "jabber:iq:search" }, "type": "result", "id": "HyT457", "from": "search.xxxxxx.com", "to": "xxxx@xxxx" }

Am I missing something? Any configuration is needed for sending stanzas?

Thank you.

MrScorp avatar Feb 16 '19 15:02 MrScorp

WritableMap.hasKey method is always returning false. Have submitted a PR for the fix.

MrScorp avatar Feb 17 '19 15:02 MrScorp

Hi @MrScorp it seems that the problem is not at the parse, but in the data sent to it wich only contain the "message" tag, right?

Did you be able to solve this? We are struggling with this same issue.

penna-superlogica avatar Oct 21 '20 15:10 penna-superlogica