2012-05-23 54 views
3

我想用robbiehanson XMPPframework创建聊天室。iOS XMPP群聊实施

因为我没有得到任何的代码和文档,我做了一个尝试自己发起的聊天室如下:

XMPPRoomMemoryStorage *rosterstorage = [[XMPPRoomMemoryStorage alloc] init]; 
    XMPPRoom *xmppRoom = [[XMPPRoom alloc] initWithRoomStorage:rosterstorage jid:[XMPPJID jidWithString:@"[email protected]/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="[email protected]" to="[email protected]/42512304551337785705750233" type="error"><x xmlns="http://jabber.org/protocol/muc#user"><invite to="[email protected]"><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?是否有任何示例代码此??任何帮助将提前appreciated..Thanks ..

回答

5

最后我想通了。它可以帮助某人。在创建或加入房间时,格式应为[email protected]。会议是这里的关键词。

-1

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

2

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

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