Firebase电话身份验证在Ionic 4 App中未收到OTP

时间:2020-03-13 06:36:58

标签: firebase firebase-authentication ionic4 firebase-console one-time-password

我正在使用Cordova FirebaseX Plugin验证电话号码,以便使用户登录我的Ionic 4安卓应用。 如果验证码(OTP)与firebase发送的OTP相匹配,则在下面的代码中登录用户。

this.firebaseX.verifyPhoneNumber(res => {
        console.log(res['verificationId']);
        if (res['instantVerification']) {
            if(awaitingSms){
            awaitingSms = false;
            // the Android device used auto-retrieval to extract and submit the verification code in the SMS so dismiss user input UI
            dismissUserPromptToInputCode();
          }   
         signInWithCredential(res);
        }
        else {
             awaitingSms = true;
             promptUserToInputCode() 
            .then(function(userEnteredCode){
                awaitingSms = false;                
                res['code'] = userEnteredCode; // set the user-entered verification code on the credential object
                signInWithCredential(res); 
            });
    }
}, function(error) {
    console.error("Failed to verify phone number: " + JSON.stringify(error));
}, number, timeOutDuration);

以上方法从昨天开始在我的ASUS ROG II安卓手机上停止工作。无论我在ASUS ROG II中输入的电话号码如何,我都可以看到对象res中的verificationId保持不变,因此我无法从firebase接收OTP。我在其他Android设备上测试了代码,每个电话号码的对象res中的VerificationId都不相同,因此设备从Firebase接收了OTP。

是什么导致我的ASUS ROG II上的VerificationId保持不变。我应该怎么做才能使ASUS ROG II收到OTP?

编辑

我可以在Firebase控制台的ASUS ROG II手机上找到未经认证的标签。 enter image description here

任何人都可以让我知道是什么原因造成的,以及如何克服?

0 个答案:

没有答案