iosxmppchatroommultiuserchat

Xmpp IOS multiuser chat . i didnot find a way to accept the invitation from group ? how i can accept the incomming invitation


When I send an invitation this function is called, but I can't understand what line of code I should use for accept invitation.

I am trying to create a multi user and multi groups invitation also called did received message function.

- (void)xmppMUC:(XMPPMUC *) sender roomJID:(XMPPJID *) roomJID didReceiveInvitation:(XMPPMessage *)message 
{ 
}

Solution

  • to accept the incoming invitation :

    - (void)xmppMUC:(XMPPMUC *)sender roomJID:(XMPPJID *) roomJID didReceiveInvitation:(XMPPMessage *)message
    { XMPPRoom *mu = [[XMPPRoom alloc] initWithRoomStorage:xmpproomMstorage jid:roomJID
                                               dispatchQueue:dispatch_get_main_queue()];
    
        [mu   activate:xmppStream];
        [mu   addDelegate:self delegateQueue:dispatch_get_main_queue()];
    
        self.toSomeOne = roomJID;
    
        [mu activate: self.xmppStream];
        [mu fetchConfigurationForm];
        [mu addDelegate:self delegateQueue:dispatch_get_main_queue()];
        [mu joinRoomUsingNickname:xmppStream.YourJid.user history:nil password:@"Your Password"];
    self.toSomeOne = roomJID;
        XMPPPresence *presence = [XMPPPresence presence];
       [[self xmppStream] sendElement:presence];
        [xmppRoster addUser:roomJID  withNickname:roomJID.full];
        [self goOnline];
    }