Question

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,

Was it helpful?

Solution

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 ~

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top