ios - OS X ejabberd, New user register by XMPPFramework -


i'm new ejabberd. want add new user on server through ios app. i tried many code find out google no 1 can solve issue.

i set module http://localhost:5280/admin/server/localhost/node/ejabberd@localhost/modules/

enter image description here enable mod_register change ejabberd.yml file etc/ejabberd folder.

enter image description here

and listened ports @ ejabberd@localhost

enter image description here

and used below code register user.

nsxmlelement *query = [nsxmlelement elementwithname:@"query" xmlns:@"jabber:iq:register"];         [query addchild:[nsxmlelement elementwithname:@"username" stringvalue:@"syam"]];         [query addchild:[nsxmlelement elementwithname:@"password" stringvalue:@"vrin@123"]];         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 error details."                                                                delegate:nil                                                       cancelbuttontitle:@"ok"                                                       otherbuttontitles:nil];             [alertview show];         } 

but didn't success , occurred below error message.

<iq xmlns="jabber:client" from="himanshu@localhost" to="himanshu@localhost/15505992182228745748626" type="error" id="reg2"><query xmlns="jabber:iq:register"><username>syam</username><password>vrin@123</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 handling query</text></error></iq>

please me solve issue.

access: register means - already registered users able access mod_register (to change password, example). need have access: all allow registration. , not forget protect registration captcha when server opened public network (and in case simple registration implementation in xmppframework not enough)

also it's not clear mod_register enabled virtualhost, check mod_register presence in modules: block of configuration


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -