当从 Firebase 云消息传递服务收到确认消息时,我的 addAsyncStanzaListner 被调用。我需要根据文档确认此消息。我遇到的问题是我无法到达接收到的消息节中到达的 JSON 对象内的“message_type”“key”/“value”对。你能帮我访问这个重要的价值/对吗?我正在使用 Smack 库 4.1。我一直在关注这个设置的帖子答案,但不知何故它不起作用: GCM XMPP Server using Smack 4.1.0
代码如下所示:
other_connection.addAsyncStanzaListener(new StanzaListener() {
@Override
public void processPacket(Stanza packet) throws SmackException.NotConnectedException {
//how should i convert this stanza into a message stanza
//I have tried Message message = (Message)packet; IT DOESNT WORK
//I have tried getting the extension with the GCM Namespace. It doesnt
//return a json string