相关疑难解决方法(0)

读取Firebase Auth错误(Firebase 3.x和Swift)

我无法弄清楚如何在新版本的Firebase中读取FIRAuthErrorNameKey.以下是我到目前为止,但"let errorCode = FIRAuthErrorNameKey"行不正确.从阅读Firebase文档,我也尝试从userInfo访问错误代码,但没有成功,我的想法.

 // Send request to Firebase to add user to register user
 FIRAuth.auth()?.createUserWithEmail(emailTextField.text!, password: passwordTextField.text!, completion: { (user, error) in

        // Check for errors and respond to user accordingly.
        if error != nil {

            let errorCode = FIRAuthErrorNameKey

            switch errorCode {

            case "FIRAuthErrorCodeEmailAlreadyInUse":

                // Add logic accordingly

            case ...:

               // Add logic accordingly

            case default:

              // Add logic accordingly
            }
        }
 })
Run Code Online (Sandbox Code Playgroud)

ios firebase swift firebase-authentication

11
推荐指数
4
解决办法
8271
查看次数

标签 统计

firebase ×1

firebase-authentication ×1

ios ×1

swift ×1