1

我使用这个创建了新的群聊房间-

XMPPRoomCoreDataStorage *rosterstorage = [[XMPPRoomCoreDataStorage alloc] init];
XMPPRoom *xmppRoom = [[XMPPRoom alloc] initWithRoomStorage:rosterstorage jid:[XMPPJID jidWithString:@"viratsroom@conference.praveens-mac-mini.local"] dispatchQueue:dispatch_get_main_queue()];

[xmppRoom activate:[[self appDelegate] xmppStream]];
if ([xmppRoom preJoinWithNickname:@"viratsRoom"]) {
  NSLog(@"room created");
  [xmppRoom joinRoomUsingNickname:@"viratsroom11" history:nil];
}
[xmppRoom fetchConfigurationForm];
[xmppRoom configureRoomUsingOptions:nil];
[xmppRoom addDelegate:[self appDelegate] delegateQueue:dispatch_get_main_queue()];

正在创建房间但出现错误

我在服务器端进行了跟踪,发现了这个错误-

     "presence xmlns="jabber:client" from="viratsroom@conference.iisd09/arup" to="arup@iisd09/ClientXMPP" type="error" error code="404" type="wait"  recipient-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"
4

1 回答 1

3

房间没有正确配置,因此在创建房间后立即调用它的所有错误都不起作用-

[xmppRoom fetchConfigurationForm]; 
[xmppRoom configureRoomUsingOptions:nil];

创建房间需要一点时间,然后您可以配置房间。

[self performSelector:@selector(ConfigureNewRoom:) withObject:nil afterDelay:2];

谢谢

于 2012-07-17T11:25:26.523 回答