I can see now the users manually created in my openfire server, i am working with a book to achieve this but, there is a way the programmer register a user via http using the openfire and the user service plugin. I want to know how to register a new user with this feature and if i can check if the user already exists on the openfire server with my iOS application. How can i get the http link of my openfire to achieve a registration or is there another way? i read that for custom registration it would be good to create a webservice but i know very little about webservices so please anyone can help, Thanks.
You need to register a user by creating an NSXMLElement and pass it to the xmppstream to register new user.Make sure you have xmppstream object so that you are able to fire your queries to server and get the required output.
NSMutableArray *elements = [NSMutableArray array];
[elements addObject:[NSXMLElement elementWithName:@"username" stringValue:@"abc"]];
[elements addObject:[NSXMLElement elementWithName:@"password" stringValue:@"xyz"]];
[elements addObject:[NSXMLElement elementWithName:@"name" stringValue:@"abc"]];
[elements addObject:[NSXMLElement elementWithName:@"email" stringValue:@"[email protected]"]];
[self.xmppStream registerWithElements:elements error:nil];
[self connect];
This will register a new user or in-case the user already exists on your server it gives you an error in received iq.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments