[英]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.