Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift firebase FIRUser.sendEmailVerificationWithCompletion(FIRUser)函数的示例_Swift_Firebase_Firebase Authentication - Fatal编程技术网

Swift firebase FIRUser.sendEmailVerificationWithCompletion(FIRUser)函数的示例

Swift firebase FIRUser.sendEmailVerificationWithCompletion(FIRUser)函数的示例,swift,firebase,firebase-authentication,Swift,Firebase,Firebase Authentication,: 谁能给我举一个如何使用这个函数的例子吗? 如果您能在括号内键入什么内容,我将不胜感激。 这些链接对该函数进行了一些解释。正如您在文档中看到的,回调是可选的。该函数将在电子邮件验证完成后立即调用。因此,您应该使用此参数在验证完成后调用所需的任何逻辑 在下面的示例中,在iAction中调用验证,并在完成后测试是否发生任何错误 @IBAction func didRequestVerifyEmail(sender: AnyObject) { FIRAuth.auth()?.curren

:

谁能给我举一个如何使用这个函数的例子吗? 如果您能在括号内键入什么内容,我将不胜感激。
这些链接对该函数进行了一些解释。

正如您在文档中看到的,回调是可选的。该函数将在电子邮件验证完成后立即调用。因此,您应该使用此参数在验证完成后调用所需的任何逻辑

在下面的示例中,在iAction中调用验证,并在完成后测试是否发生任何错误

@IBAction func didRequestVerifyEmail(sender: AnyObject) {
     FIRAuth.auth()?.currentUser?.sendEmailVerificationWithCompletion({ (error) in
          if let error = error {
            print(error.localizedDescription)
            return
          }
          print("Sent")
     })
}

嘿@marc,如果你还有其他问题,请告诉我。如果没有,请将我的答案设置为“已接受”好吗?谢谢