您好我正在尝试将 Parse Api 的数据库用于我的项目,该项目需要 Parse 提供的用户帐户。当我在https://parse.com/docs/android_guide#users阅读有关如何设置用户帐户的教程时, 它指出:
“在应用程序的设置中启用电子邮件验证允许应用程序为已确认电子邮件地址的用户保留部分体验。电子邮件验证将 emailVerified 键添加到 ParseUser 对象。设置或修改 ParseUser 的电子邮件时,emailVerified 设置为 false。 Parse 然后通过电子邮件向用户发送一个链接,该链接会将 emailVerified 设置为 true。”
每当用户尝试注册时,您将如何添加 emailVerification key = true :
ParseUser user = new ParseUser();
user.setUsername(username);
user.setPassword(password);
user.setEmail(email);
user.signUpInBackground(new SignUpCallback() {
public void done(ParseException e) {
if (e == null) {
// sign up succeeded so go to multiplayer screen
// store the username of the current player
currentUser = username;
final String title = "Account Created Successfully!";
final String message = "Please verify your email before playing";
buildAlertDialog(title, message, true);
} else {
// sign up didnt succed. //TODO: figure out how do deal with error
final String title = "Error Account Creation failed";
final String message = "Account could not be created";
buildAlertDialog(title, message, false);
}
}
});