【发布时间】:2017-06-08 02:58:21
【问题描述】:
我可以成功创建群聊室 XMPP(smack)。我已经添加了 邀请听众,但从未打电话。有人知道怎么做吗?
使用:
- XMPP
- Smack 4.2
- Openfire 服务器
发送邀请码:
muc.invite(userId +"@" +XMPP.getInstance().HOST + "/Smack", "Meet me in this excellent room");
邀请监听代码:
MultiUserChatManager manager = MultiUserChatManager.getInstanceFor(connection);
manager.addInvitationListener(new InvitationListener() {
@Override
public void invitationReceived(XMPPConnection xmppConnection, MultiUserChat muc, String inviter, String reason, String password, Message message) {
try {
muc.join(nickname);
} catch (SmackException.NoResponseException e) {
e.printStackTrace();
} catch (XMPPException.XMPPErrorException e) {
e.printStackTrace();
} catch (SmackException.NotConnectedException e) {
e.printStackTrace();
}
}
});
【问题讨论】:
标签: android openfire smack multiuserchat