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.

有帮助吗?

解决方案

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];
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top