emailVerification = false in parse
嗨,我正在尝试将Parse Api的数据库用于我的项目,该数据库需要Parse提供的用户帐户。 在我阅读有关如何设置用户帐户的教程时,
https://parse.com/docs/android_guide#users指出:
"在应用程序的设置中启用电子邮件验证可以使应用程序将部分体验保留给具有确认电子邮件地址的用户。电子邮件验证将emailVerified密钥添加到ParseUser对象。设置或修改ParseUser的电子邮件时,emailVerified设置为false。 然后,解析将通过电子邮件向用户发送一个链接,该链接会将emailVerified设置为true。"
每当用户尝试注册时,您将如何精确地添加emailVerification键= true:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 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); } } }); |
转到parse.com仪表板,转到设置,电子邮件设置,然后打开"验证用户电子邮件"。
无需代码。