我正在开发iOS中聊天应用。 在XMPP服务器(Ejabberd在这种情况下,我已经启用MUC)。 我已经注册了用户,并正试图创建一个使用用户注册一个聊天室。 此外,在MUC,主机设置正确定义
{host, "conference.@HOST@"}
但我不能够创建一个聊天室
我使用的代码如下
XMPPRoomCoreDataStorage *rosterstorage = [[XMPPRoomCoreDataStorage alloc] init];
NSString *jid =[[NSUserDefaults standardUserDefaults] valueForKey:@"UserName"];
jid=[jid stringByReplacingOccurrencesOfString:@"@localhost" withString:@""];
jid=[jid stringByAppendingString:@"@conference.localhost"];
NSLog(@"jid is here :%@",jid);
// timok@conference.localhost
XMPPRoom *xmppRoom = [[XMPPRoom alloc] initWithRoomStorage:rosterstorage jid:[XMPPJID jidWithString:jid] dispatchQueue:dispatch_get_main_queue()];
[xmppRoom activate:[appdel xmppStream]];
[xmppRoom fetchConfigurationForm];
[xmppRoom configureRoomUsingOptions:nil];
[xmppRoom addDelegate:appdel delegateQueue:dispatch_get_main_queue()];
[xmppRoom inviteUser:[XMPPJID jidWithString:@"motik@localhost"] withMessage:@"Hi join room"];
在上面的代码蒂莫克河和motik是注册用户。 当我试图创建一个房间,我提示以下错误:
2014-04-29 18:25:27:996 konnectlinks[16112:5e03] SEND: <message to="timok@conference.localhost"><x xmlns="http://jabber.org/protocol/muc#user"><invite to="motik@localhost"><reason>Hi join room</reason></invite></x></message>
2014-04-29 18:25:28:280 konnectlinks[16112:5a43] RECV: <iq xmlns="jabber:client" from="localhost" id="99D56CEF-3DEA-4D3D-B186-D3B1C28FEE8F" type="error"><error code="503" type="cancel"><service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>
2014-04-29 18:25:28:280 konnectlinks[16112:a0b] paduaAppDelegate: xmppStream:didReceiveIQ:
2014-04-29 18:25:28:564 konnectlinks[16112:5a43] RECV: <iq xmlns="jabber:client" from="localhost" id="D9F3BE9A-F4EB-4361-8F1A-C51FD5880AD8" type="error"><error code="503" type="cancel"><service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>
2014-04-29 18:25:28:564 konnectlinks[16112:a0b] paduaAppDelegate: xmppStream:didReceiveIQ:
2014-04-29 18:25:28.564 konnectlinks[16112:a0b] didNotConfigure
如何解决这个问题的任何想法会有很大的帮助。