使用phoneNumber进行Firebase身份验证失败并出现内部错误

时间:2019-01-10 04:25:53

标签: swift firebase firebase-authentication

我要使用Firebase SMS Authentication和电话号码。

我已经在我的应用设置中启用了推送通知,并按照Google文档所述注册了Firebase Apns身份验证密钥。 但是,在我发送带有国家/地区代码的电话号码后,Xcode说,

  

无法在5天内收到远程通知以验证应用程序身份的通知   秒

错误如下:

    error: Error Domain=FIRAuthErrorDomain Code=17999 "An internal error has occurred, print and inspect the error details for more information." UserInfo={error_name=ERROR_INTERNAL_ERROR, NSLocalizedDescription=An internal error has occurred, print and inspect the error details for more information., NSUnderlyingError=0x28329c8a0 {Error Domain=FIRAuthInternalErrorDomain Code=3 "(null)" UserInfo={FIRAuthErrorUserInfoDeserializedResponseKey={
    code = 500;
    errors =     (
                {
            domain = global;
            message = "Internal error encountered.";
            reason = backendError;
        }
    );
    message = "Internal error encountered.";
    status = INTERNAL;
}}}}

我的代码:

    PhoneAuthProvider.provider().verifyPhoneNumber(phoneNumber, uiDelegate: nil) { verificationId, error in
                if let error = error {
                    print("error: \(error)")
                    return
                }
                print("verificationId: \(verificationId!)")
                UserDefaults.standard.set(verificationId, forKey: "authVerificationID")
                self.goToSecondVC()
            }

有什么想法吗?

0 个答案:

没有答案