【问题标题】:XMPP - How to join an existing MUC roomXMPP - 如何加入现有的 MUC 房间
【发布时间】:2012-10-18 01:34:06
【问题描述】:

如何加入我的 openfire 服务器上的现有 MUC?

我已成功使用我的凭据和所有凭据加入服务器。

但我似乎找不到任何关于如何加入 MUC 的代码示例?

【问题讨论】:

  • 你必须被邀请到一个 MUC 房间。

标签: ios objective-c xmpp xmppframework


【解决方案1】:

0045http://xmpp.org/extensions/xep-0045.html

只需按照所有步骤操作,您就可以进行多用户聊天。希望它对你有用:)

【讨论】:

    【解决方案2】:

    试试这个

    - (void)joinRoomWithRoomName:(NSString *)roomName nickName:(NSString *)nickName 
        {
            if(roomName && nickName)
            {
                _xmppRoomStorage = [XMPPRoomHybridStorage sharedInstance];
                XMPPJID *roomJid = [XMPPJID jidWithString:[NSString stringWithFormat:@"%@@%@.%@",roomName,@"conference",self.hostName]];
                _xmppRoom = [[XMPPRoom alloc] initWithRoomStorage:_xmppRoomStorage jid:roomJid];
                [_xmppRoom addDelegate:self delegateQueue:dispatch_get_main_queue()];
                [_xmppRoom activate:_xmppStream];
                NSXMLElement *history = [NSXMLElement elementWithName:@"history"];
                [history addAttributeWithName:@"maxstanzas" stringValue:MAX_ROOM_HISTORY];
                [_xmppRoom joinRoomUsingNickname:nickName history:history];
            }
            else
            {
                NSLog(@"room creation arguments missing");
            }
        }
    

    【讨论】:

      猜你喜欢
      • 2015-05-17
      • 2016-10-25
      • 2017-04-21
      • 1970-01-01
      • 2016-04-09
      • 2015-06-24
      • 2018-10-05
      • 2012-09-13
      • 2016-02-17
      相关资源
      最近更新 更多