邀请监听器不工作 smack 4.1

Invitation Listener not working smack 4.1

我在我的应用程序中使用 smack 4.1, 我可以发送邀请,但我没有收到邀请

事实上,在调试时,我在 ChatMessageListener() 中收到了邀请 ,在数据包扩展中我可以获得整个邀请,但我不想削减 XML .

我的 InvitationLisenter() 从未 调用过

final MultiUserChatManager manager = MultiUserChatManager.getInstanceFor(connection);
    manager.addInvitationListener(new InvitationListener() {
        @Override
        public void invitationReceived(XMPPConnection xmppConnection, MultiUserChat multiUserChat, String s, String s1, String s2, Message message) {
            try {
                multiUserChat.join(mUserName);
            } catch (SmackException.NoResponseException e) {
                e.printStackTrace();
            } catch (XMPPException.XMPPErrorException e) {
                e.printStackTrace();
            } catch (SmackException.NotConnectedException e) {
                e.printStackTrace();
            }
        }
    });

xmpp 中有两种类型的房间邀请,

直接邀请

作为普通消息发送并通过 ChatMessageListener() 接收 ,我正在使用此代码从消息

中获取邀请
GroupChatInvitation invite = (GroupChatInvitation)result.getExtension("x","jabber:x:conference");


中介邀请

InvitationLisenter()

一起收到