As we already know that Parse.com provides a schema-less database. It provides a complete backed solution for mobile applications.
In order to register a user with parse, we use ParseUser class. It is a specialized class that automatically handles the functionality required for User Management System. It is a subclass of ParseObject. ParseObject is the base class that responsible for storing data in Parse.
ParseUser contains all the methods of ParseObject. Along with ParseObject methods, ParseUser also have some additional methods.
Following are the unique properties of ParseUser
username: The username for the user (required).
password: The password for the user (required on signup).
email: The email address for the user (optional).
Below code is use to register a user in Parse
ParseUser user = new ParseUser();
user.setUsername("user name");
user.setPassword("user password");
user.setEmail("useremail@example.com");
// other fields can be set just like with ParseObject
user.put("phone", "9991234567);
user.signUpInBackground(new SignUpCallback() {
public void done(ParseException e) {
if (e == null) {
// Hooray! Let them use the app now.
// Signup Successfully
} else {
// Sign up didn't succeed. Look at the ParseException
// to figure out what went wrong
}
}
});
0 Comment(s)