Pergunta

I've been searching for a good XMPP with chatroom tutorial. I found this tutorial helpful, but still no luck on implementing multi-user chat.

Can someone give me a good reference for this?

Thanks in advance.

Foi útil?

Solução

if you just follow this way, you can make the XMPP chat room. and you have to configure some settings about a room.

  • (void)xmppRoom:(XMPPRoom *)sender didConfigure:(XMPPIQ *)iqResult

this delegate method will be called ~ and you can set up what you want by XMPP - 045 document

    XMPPRoomMemoryStorage *roomMemory = [[XMPPRoomMemoryStorage alloc]init];

    roomID = [NSString stringWithFormat:@"%@@%@",_subjectOfRoom.text,szRoomName];
    XMPPJID *roomJID = [XMPPJID jidWithString:roomID];

    XMPPRoom *xmppRoom = [[XMPPRoom alloc]initWithRoomStorage:nil
                                                          jid:roomJID
                                                dispatchQueue:dispatch_get_main_queue()];

    [xmppRoom addDelegate:self delegateQueue:dispatch_get_main_queue()];

    [xmppRoom activate:[[JSXMPP_Singletone sharedInstanc]xmppStream]];

    [xmppRoom joinRoomUsingNickname:@"KIM"
                            history:nil
                           password:nil];
    [xmppRoom configureRoomUsingOptions:nil];
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top