iOS XMPP群聊实施

我正在尝试使用robbiehanson XMPPframework创build聊天室。

由于我没有得到任何示例代码或文档,我自己尝试启动一个聊天室,如下所示:

XMPPRoomMemoryStorage *rosterstorage = [[XMPPRoomMemoryStorage alloc] init]; XMPPRoom *xmppRoom = [[XMPPRoom alloc] initWithRoomStorage:rosterstorage jid:[XMPPJID jidWithString:@"test@mycompany.com/room"] dispatchQueue:dispatch_get_main_queue()]; [xmppRoom configureRoomUsingOptions:nil]; [xmppRoom activate:[UIAppDelegate xmppStream]]; [xmppRoom addDelegate:UIAppDelegate delegateQueue:dispatch_get_main_queue()]; [xmppRoom inviteUser:[XMPPJID jidWithString:jabberID] withMessage:@"Hi join room"]; 

但是我在控制台中得到响应:

  RECV: <message xmlns="jabber:client" from="test@mycompany.com" to="user1@mycompany.com/42512304551337785705750233" type="error"><x xmlns="http://jabber.org/protocol/muc#user"><invite to="user2@mycompany.com"><reason>Hi join room</reason></invite></x><error code="503" type="cancel"><service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></message> 

任何人有任何想法发起MUC?有没有任何示例代码?任何帮助将不胜感激..预先感谢..

最后我明白了。 它可以帮助某人。 创build或join房间时,格式应为yourRoomName@conference.YourDomainName.com 。 会议是这里的关键词。

每个房间被标识为“房间JID”(例如),其中“房间”是MUC房间的名称,“服务”是多用户聊天服务正在运行的主机名。 参考XEP-0045

必须使用关键字“ 会议 ”才能使用XMPP客户端启动群组聊天。

据我所知,MUC是不可能与facebook XMPP服务器,因为它是一个精简。 他们没有明确地说,但我发现在pidgin wiki(这是德语)的一些提示: http : //wiki.pidgin-im.de/index.php/Facebook 。 我一直在努力处理这个话题