Reputation: 3814
I am trying to receive XMPP custom stanzas inside a message packet. For instance,
<message ...>
<custom_stanza>
<foo>wololo</foo>
<bar>haiooh</bar>
</custom_stanza>
...
</message>
The point is that I know I will receive a "custom_stanza" stanza but I do not know about the names of the tags "foo" and "bar", and I need to retrieve the data inside them.
I have used an EmbeddedExtensionProvider
subclass which gives me the names of "foo" and "bar" but I am not able to retrieve "wololo" nor "haiooh". How can I achieve this?
Cheers,
Upvotes: 2
Views: 2445
Reputation: 2507
If you use PacketExtension
to send custom stanzas, as this thread explained: https://stackoverflow.com/a/6390037/474002
Then, you could use smack api Packet.getExtensions
as the document: http://www.igniterealtime.org/builds/smack/docs/latest/javadoc/org/jivesoftware/smack/packet/Packet.html#getExtensions()
Hope this will help ~
Upvotes: 2