【发布时间】:2016-10-12 12:51:31
【问题描述】:
自从更新到 Swift 3.0 后,即使使用正确的密码,我也会收到不正确的消息。有人在 Firebase 上授权用户时遇到过这个问题吗?
@IBAction func LoginToAccount(_ sender: AnyObject) {
if let email = emailLogin.text, let password = passwordLogin.text {
FIRAuth.auth()?.signIn(withEmail: email, password: password, completion: {
(user, error) in
if error != nil{
print("Incorrect")
let alert = UIAlertController(title: "Error", message: "Incorrect Email or Password.", preferredStyle: UIAlertControllerStyle.alert)
let action = UIAlertAction(title: "Ok", style: .default, handler: nil)
alert.addAction(action)
self.present(alert, animated: true, completion: nil)
}else{
if error == nil {
self.performSegue(withIdentifier: "AdminSegue", sender: self)
}
}
})
}
}
}
【问题讨论】:
-
你说的不工作是什么意思?
-
如果您向我们展示错误消息是什么,将会很有用。
-
我的意思是即使使用正确的密码,我也只会收到消息字符串“不正确的电子邮件或密码”。在更新到 Swift 3.0 之前工作正常
-
好吧,真奇怪。登录在设备上工作正常,只是在模拟器中不起作用。这只是因为更新到 Xcode 8
标签: ios firebase swift3 firebase-authentication