gpt4 book ai didi

IOS - Firebase - 此电子邮件格式错误

转载 作者:行者123 更新时间:2023-11-28 15:11:46 26 4
gpt4 key购买 nike

在集成 firebase 之后,我正在开发一个 IOS 项目。我收到此错误“此电子邮件格式错误”这是代码

 @IBAction func registerBtn(_ sender: Any) {

if userNameTxt.text != "" && passwordTXT.text != "" {
Auth.auth().createUser(withEmail: userNameTxt.text!, password: passwordTXT.text!, completion: { (user, error) in

if error != nil {
let alert = UIAlertController(title: "Error", message: error?.localizedDescription, preferredStyle: UIAlertControllerStyle.alert)
let okButton = UIAlertAction(title: "OK", style: UIAlertActionStyle.cancel, handler: nil)
alert.addAction(okButton)
self.present(alert, animated: true, completion: nil)
} else {

UserDefaults.standard.set(user!.email, forKey: "user")
UserDefaults.standard.synchronize()

}


})

} else {
let alert = UIAlertController(title: "Error", message: "Kullanıcı Adı ve Şifre Gerekli", preferredStyle: UIAlertControllerStyle.alert)
let okButton = UIAlertAction(title: "OK", style: UIAlertActionStyle.cancel, handler: nil)
alert.addAction(okButton)
self.present(alert, animated: true, completion: nil)
}

}

最佳答案

Firebase 在使用 createUser 时进行电子邮件验证。检查 userNameTxt 标签中包含的字符串是否是有效的电子邮件。

关于IOS - Firebase - 此电子邮件格式错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47519307/

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