这是我的应用程序:https://play.google.com/store/apps/details?id=codechintan.risingbee.android
与同一设备上数量的具有应用和SIM卡装置,火力认证不起作用。
它发送OTP,但不会验证,并且不会响应函数
// sign in with the credential
firebase.auth().signInWithCredential(credential);
它适用于其他设备。
我使用的科尔多瓦:https://www.npmjs.com/package/cordova-plugin-firebase。也使用离子亲框架来构建应用程序。
我们已经开发了其中使用火力地堡电话认证集成的应用程序。
我们使用的插件,并且它的代码,插件的链接 - https://www.npmjs.com/package/cordova-plugin-firebase
Android的应用程序使用离子框架和科尔多瓦发展。
这是手机身份验证不工作,它发送OTP但电话确认不工作,如果一个应用程序和电话号码都在同一台设备。
例如:号码+91 9575XXXXXX是我的电话,如果我在同一设备安装应用程序的认证过程中没有工作!它发出OTP,但不会验证!
现在,如果我尝试另一个号码(SIM卡,数量是不是在为设备应用)认证过程的工作。这是非常奇怪的。
我认为,这是在插件的问题(https://www.npmjs.com/package/cordova-plugin-firebase)
当使用自己的手机号码credential.verificationId越来越假的!在下面的功能。
window.FirebasePlugin.verifyPhoneNumber(number, timeOutDuration, function(credential) {
console.log(credential);
// ask user to input verificationCode:
var code = inputField.value.toString();
var verificationId = credential.verificationId;
//THIS verificationId IS GETTING FALSE!!!
var credential = firebase.auth.PhoneAuthProvider.credential(verificationId, code);
// sign in with the credential
firebase.auth().signInWithCredential(credential);
// call if credential.instantVerification was true (android only)
firebase.auth().signInWithCustomToken(customTokenFromYourServer);
// OR link to an account
firebase.auth().currentUser.linkWithCredential(credential)
}, function(error) {
console.error(error);
});
因为这样你就需要提供测试手机号码此错误与模拟器firebase
电话验证相关
去
firebase console -> Authentication -> SIGN-IN Method -> Phone
和添加测试电话号码。