Я сделал это, используя код ниже.
XMPPRoomCoreDataStorage * rosterstorage = [[XMPPRoomCoreDataStorage alloc] init];
XMPPRoom * xmppRoom = [[XMPPRoom alloc] initWithRoomStorage: js реестра: [XMPPJID jidWithString: @ "MyFirstGroup@conference.test-desktop"] dispatchQueue: dispatch_get_main_queue ()];
[xmppRoom activate:[[self appDelegate]xmppStream]];
[xmppRoom joinRoomUsingNickname:@"DeveloperQ" history:nil];
[[[self appDelegate] xmppStream] addDelegate:self delegateQueue:dispatch_get_main_queue()];
[xmppRoom addDelegate:self delegateQueue:dispatch_get_main_queue()];
Тогда
- (void) xmppRoomDidJoin: (XMPPRoom *) отправитель
{
NSXMLElement * iq = [NSXMLElement elementWithName: @ "iq"];
[iq addAttributeWithName:@"id" stringValue:[NSString stringWithFormat:@"inroom-cr%@",groupName]];
[iq addAttributeWithName:@"to" stringValue::@"MyFirstGroup@conference.test-desktop"];
[iq addAttributeWithName:@"type" stringValue:@"set"];
NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:XMPPMUCOwnerNamespaceName];
NSXMLElement *xelem = [NSXMLElement elementWithName:@"x" xmlns:@"jabber:x:data"];
[xelem addAttributeWithName:@"type" stringValue:@"submit"];
[query addChild:xelem];
[iq addChild:query];
[[[self appDelegate] xmppStream] sendElement:iq];
}