gpt4 book ai didi

ios - 类型 'AuthDataResult' 的值没有成员 'isEmailVerification'

转载 作者:行者123 更新时间:2023-11-28 11:57:22 25 4
gpt4 key购买 nike

我在我的应用程序上配置启动 session 时遇到了一个小问题,这是:“‘AuthDataResult’类型的值没有成员‘isEmailVerification’”

func signIn(email:String?, password:String?) {
if email == nil || password == nil {
showAlert(title: "Login Error!", message: "All fields are required.")
} else {
SwiftLoader.show(animated: true)

Auth.auth().signIn(withEmail: email!, password: password!) { (user, error) in
SwiftLoader.hide()

if let err = error {
self.showAlert(title: "Login Error!", message: err.localizedDescription)
} else {
if (user?.isEmailVerification){ //error:"Value of type 'AuthDataResult' has no member 'isEmailVerification'"
self.sendEmailVerification()
}else{
self.showAlert(title: "", message: "Has iniciado sesión correctamente")
}
}
}
}
}

最佳答案

返回的类型是AuthDataResult,包含用户对象FIRUser

user?.user.isEmailVerified

您最好重命名回调以避免阅读困惑,请参阅文档中的此处

AuthDataResult

FIRUser

关于ios - 类型 'AuthDataResult' 的值没有成员 'isEmailVerification',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50725957/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com