[英]Join an existing XMPP MUC Room with Owner Privileges using iOS Openfire and Robbie Hanson library
[英]XMPP - How to join an existing MUC room
如何加入我的openfire服务器上的现有MUC?
我已经设法加入了我的凭据和所有的服务器。
但我似乎无法找到任何代码样本如何加入MUC?
0045 http://xmpp.org/extensions/xep-0045.html
JUst遵循所有步骤,您可以进行多用户聊天。 希望这对你有用 :)
尝试这个
- (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");
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.