我剛將Firebase Cocoapods從3.15.0升級到4.0.4,並將FirebaseAuth Cocoapods從3.1.1升級到4.0.0。Swift3 iOS -Firebase FIREmailPasswordAuthProvider不工作
我使用電子郵件&密碼來驗證用戶身份。當用戶更改他們的電子郵件,我用下面這個方法,一切工作正常:
FIREmailPasswordAuthProviderID.credential(withEmail: emailTextField.text!, password: passwordTextField.text!)
現在我更新我得到錯誤信息
Value of type 'String' has no member 'credential'
我枕着docs和它說使用下面的方法:
的問題是我得到同樣的確切的錯誤:
FIREmailAuthProviderID.credential(withEmail: emailTextField.text!, password: passwordTextField.text!)
Value of type 'String' has no member 'credential'
我原來的代碼如下
import Firebase
import FirebaseAuth
let user: User?
let credential = FIREmailPasswordAuthProviderID.credential(withEmail: emailTextField.text!, password: passwordTextField.text!)
if let user = user{
user.reauthenticate(with: credential, completion: {
(error) in
if error != nil{
//...do something
return
}
//...do something else
})
}
我在做什麼錯?
嘿謝謝你的幫助!我昨天晚上再次嘗試了,現在我得到了錯誤「使用未解析的標識符'EmailPasswordAuthProvider' –
@LanceSamaria它* EmailAuthProvider *沒有* EmailPasswordAuthProvider * – Jay
哦射擊是的,這是它!謝謝!!! –