3

I have an application which I am using for one-to-one chat. Now I need to implement group chat. I know it is possible with XMPPFramework and there is a class called XMPPRoom which we can use to create a room or join a room. But I am unable to implement that in my project.

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

Keith OYS
  • 2,285
  • 5
  • 32
  • 38
Naveen
  • 900
  • 1
  • 7
  • 23
  • Why are you unable to implement that in your project? What have you tried? What specific problem are you encountering. Please don't use StackOverflow as a place to ask people to do your work for you. – Nick Bull Jan 27 '12 at 11:07
  • Take a read at: http://stackoverflow.com/questions/6786813/xmppframework-how-to-create-a-muc-room-and-invite-users/24179388#24179388 – Keith OYS Jun 24 '14 at 09:38

2 Answers2

2

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

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

In order to do this you should have access to the xmppStream.

subharb
  • 3,374
  • 8
  • 41
  • 72
0
- (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");
        }
    }
Suhail kalathil
  • 2,673
  • 1
  • 13
  • 12