寄存器我是新的ejabberd。我想通過我的iOS應用程序在服務器上添加新用戶。 I tried with many code這是從谷歌找到,但沒有人能解決我的問題。OS X ejabberd,新用戶通過XMPPFramework
我設置模塊http://localhost:5280/admin/server/localhost/node/[email protected]/modules/
爲了使mod_register
也etc/ejabberd
文件夾更改ejabberd.yml
文件。
而且我在ejabberd @本地
而且我用下面的代碼註冊用戶點擊端口。
NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:@"jabber:iq:register"];
[query addChild:[NSXMLElement elementWithName:@"username" stringValue:@"syam"]];
[query addChild:[NSXMLElement elementWithName:@"password" stringValue:@"[email protected]"]];
NSXMLElement *iq = [NSXMLElement elementWithName:@"iq"];
[iq addAttributeWithName:@"type" stringValue:@"set"];
[iq addAttributeWithName:@"id" stringValue:@"reg2"];
[iq addChild:query];
[APP_DELEGATE.xmppStream sendElement:iq];
[APP_DELEGATE.xmppStream setHostName:@"0.0.0.0"];
[APP_DELEGATE.xmppStream setHostPort:5222];
NSError *error;
if (![APP_DELEGATE.xmppStream connectWithTimeout:XMPPStreamTimeoutNone error:&error]) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error connecting"
message:@"See console for error details."
delegate:nil
cancelButtonTitle:@"Ok"
otherButtonTitles:nil];
[alertView show];
}
但是沒有得到成功,發生在錯誤消息下面。
<iq xmlns="jabber:client" from="[email protected]" to="[email protected]/15505992182228745748626" type="error" id="reg2"><query xmlns="jabber:iq:register"><username>syam</username><password>[email protected]</password></query><error code="503" type="cancel"><service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"></service-unavailable><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">No module is handling this query</text></error></iq>
請幫我解決我的問題。
謝謝您的回答中
modules:
塊,我已經做了「訪問:所有」,但沒有獲得成功,有關CAPTCHA其可選的,但按你的建議,我會做到這一點。 – iPatel提到模塊的更新答案config – vitalyster
不,模塊中沒有mod_register:那麼我哪裏出錯了?你能告訴我,因爲我的.yml文件配置是正確的。 – iPatel