解析将电子邮件发送到输入的电子邮件地址后,如何检查迅速是否已验证该电子邮件地址,然后才允许用户登录该应用程序?谢谢!

最佳答案

解析User对象,具有字段emailVerified。因此,当用户登录到应用程序时,您可以检查它:

PFUser.logInWithUsernameInBackground(email, password: password) { (user, error) in

  if error == nil{
    if let verified = user["emailVerified"] as? Bool{
      if verified == true{
       // log in
      }else{
       // show that email isn't verified
      }
    }else{
      // show that email isn't verified
    }
  }
}

10-08 05:54