您好我正在尝试将Parse Api的数据库用于我的项目,该项目需要Parse提供的用户帐户。我正在阅读有关如何设置用户帐户的教程 https://parse.com/docs/android_guide#users它说:
“在应用程序的设置中启用电子邮件验证允许应用程序为已确认电子邮件地址的用户保留部分体验。电子邮件验证会将emailVerified密钥添加到ParseUser对象。当设置或修改ParseUser的电子邮件时,将设置emailVerified 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);
}
}
});
答案 0 :(得分:4)
转到您的parse.com信息中心,转到设置,电子邮件设置并启用验证用户电子邮件。
无需代码。