Ionic framework ionic 4 firebase验证电话验证码验证另一页
我在手机上使用了firebase auth,它工作得很好,我在手机上收到了代码,但我现在遇到了一个问题 我需要验证码验证在另一个页面,而不是在同一个登录页面 我的代码:Ionic framework ionic 4 firebase验证电话验证码验证另一页,ionic-framework,firebase-authentication,ionic4,Ionic Framework,Firebase Authentication,Ionic4,我在手机上使用了firebase auth,它工作得很好,我在手机上收到了代码,但我现在遇到了一个问题 我需要验证码验证在另一个页面,而不是在同一个登录页面 我的代码: const appVerifier = this.recaptchaVerifier; return firebase.auth().signInWithPhoneNumber( this.final_phone, appVerifier).then(async (confirmationResu
const appVerifier = this.recaptchaVerifier;
return firebase.auth().signInWithPhoneNumber( this.final_phone, appVerifier).then(async (confirmationResult) => {
console.log(confirmationResult.confirm)
let alert = await this.alertCtrl.create({
header: 'من فضلك ضع كود التحقق',
inputs: [{ name: 'confirmationCode', placeholder: 'كود التحقق' }],
buttons: [
{
text: 'الغاء',
role: 'cancel',
cssClass: 'secondary',
handler: (blah) => {
console.log('Confirm Cancel: blah');
}
}, {
text: 'تاكيد',
handler: data => {
confirmationResult.confirm(data.confirmationCode)
.then(function (result) {
console.log(result.user);
}).catch(function (error) {
});
}
}
]
});
alert.present();
}).catch(
);
现在它显示了将代码放入验证的警报,但我需要转到另一个页面,在通过confirmationResult
时放入代码,然后它显示:
确认结果。确认不起作用
为什么不通过URL将数据传递到下一页?为了验证代码是否正确,我的意思是,您可以通过URL将代码传递到下一页。因为它是一个Ionic应用程序,URL将被隐藏