2012-07-11 35 views
1

我已经使用这个 -xmppframework iphone群聊收到“错误代码 - 404,接收者不可用”

XMPPRoomCoreDataStorage *rosterstorage = [[XMPPRoomCoreDataStorage alloc] init]; 
XMPPRoom *xmppRoom = [[XMPPRoom alloc] initWithRoomStorage:rosterstorage jid:[XMPPJID jidWithString:@"[email protected]"] 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="[email protected]/arup" to="[email protected]/ClientXMPP" type="error" error code="404" type="wait" recipient-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" 

回答

3

房wasnt正确配置,因此所有的错误 调用此创建房间犯规后,立即与工作

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

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

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

感谢

+0

我收到差异错误代码(400,错误的请求),但是这个代码对我的作品,感谢 – tesmojones 2012-08-06 04:23:04

+1

最好只使用委托方法: - (无效)xmppRoomDidJoin:(XMPPRoom *)寄件人 – 2013-08-12 00:28:42

相关问题