Krutarth Patel
Krutarth Patel

Reputation: 3455

How to Enable user registration - eJabberd for mac?

i am currently working with xmpp to enable chat. as
i refer this link: link 1

so i am sucesfully able to register user from console. but i want to register username from my application.

i found some links,
i also find a solution that" enable user registration in control panel".

Solution of a new user register here is my trial code

NSMutableArray *elements = [NSMutableArray array];
[elements addObject:[NSXMLElement elementWithName:@"username" stringValue:@"venkat"]];
[elements addObject:[NSXMLElement elementWithName:@"password" stringValue:@"dfds"]];
[elements addObject:[NSXMLElement elementWithName:@"name" stringValue:@"eref defg"]];
[elements addObject:[NSXMLElement elementWithName:@"accountType" stringValue:@"3"]];
[elements addObject:[NSXMLElement elementWithName:@"deviceToken" stringValue:@"adfg3455bhjdfsdfhhaqjdsjd635n"]];

[elements addObject:[NSXMLElement elementWithName:@"email" stringValue:@"[email protected]"]];

[[[self appDelegate] xmppStream] registerWithElements:elements error:nil];

but not working.

can you please exacly tell me what is the real problem?

Upvotes: 0

Views: 154

Answers (1)

Mickaël Rémond
Mickaël Rémond

Reputation: 9055

The code you are showing cannot work. It is not even sending an XMPP packet.

XMPP user registration protocol is defined in XEP-0077 - In-Band Registration. Implementation for XMPPFramework registration is here: https://github.com/robbiehanson/XMPPFramework/tree/master/Extensions/XEP-0077

You can also use native way to create user in ejabberd, for example with ejabberctl command-line, as described in ejabberd documentation: ejabberd Post Install Operations.

Upvotes: 1

Related Questions