0
我正在使用XMPP的Android聊天應用(4.1.1嫌)。 這裏是節包監聽器我用。XMPP啪4.1.1 UnsupportedIQ錯誤
但是,當我用這個監聽我UnsupportedIQ錯誤。 什麼是我錯了嗎?
connection.addAsyncStanzaListener(new StanzaListener() {
@Override
public void processPacket(Stanza p) throws SmackException.NotConnectedException {
if (p.getStanzaId().equals(getTokenId)) {
IQ iq = (IQ) p;
if (iq != null && iq.getType().equals(IQ.Type.result)) {
// here, I want to get xxxxxx value from <value xmlns='jabber:client'>xxxxxxx</value>
}
}
}, new StanzaFilter() {
@Override
public boolean accept(Stanza stanza) {
return true;
}
});
IQ tokenIQ = new IQ("query", "urn:tmp:token") {
@Override
protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) {
xml.rightAngleBracket();
return xml;
}
};
getTokenId = tokenIQ.getStanzaId();
try {
connection.sendStanza(tokenIQ);
} catch (SmackException.NotConnectedException e) {
e.printStackTrace();
}
這也太 https://www.igniterealtime.org/builds/smack/docs/latest/文檔/ providers.html – Ashishail