XMPPFramework - How to create a group chat?

I have an application that I use for individual communication. Now I need to implement group chat. I know this is possible with XMPPFramework, and there is a class called XMPPRoom that we can use to create a room or join a room. But I can not implement this in my project.

Can someone please provide me some ideas, suggestions and, if possible, a sample application. Thanks in advance:)

+2
source share
2 answers

here you have a script that allows you to connect to the room

[xmppRoom activate:[self xmppStream]]; [xmppRoom createOrJoinRoom]; 

To do this, you must have access to xmppStream.

+2
source
 - (void)createOrJoinRoomWithRoomName:(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"); } } 
0
source

Source: https://habr.com/ru/post/1391233/


All Articles