【问题标题】:iOS XMPP group chat implementationiOS XMPP 群聊实现
【发布时间】:2012-05-30 04:53:05
【问题描述】:

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

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

    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 的想法吗?有任何示例代码吗??任何帮助将不胜感激..提前致谢..

【问题讨论】:

    标签: iphone ios xmppframework


    【解决方案1】:

    我终于想通了。它可能会帮助某人。创建或加入会议室时,格式应为 yourRoomName@conference.YourDomainName.com'conference' 是这里的关键字。

    【讨论】:

      【解决方案2】:

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

      必须使用关键字“会议”才能使用 XMPP 客户端开始群聊。

      【讨论】:

        【解决方案3】:

        据我所知,Facebook XMPP 服务器无法实现 MUC,因为它是一个精简的服务器。他们没有明确说出来,但我在 pidgin wiki(它是德语)中找到了一些提示:http://wiki.pidgin-im.de/index.php/Facebook。我也一直在为这个话题而苦苦挣扎......

        【讨论】:

          猜你喜欢
          • 2016-01-26
          • 2017-07-13
          • 2016-02-29
          • 2014-02-10
          • 2018-04-07
          • 2015-01-15
          • 1970-01-01
          • 2013-10-16
          • 1970-01-01
          相关资源
          最近更新 更多