在使用navCtr
链接到repo时,我无法使用cordova-plugin-firebase
离子导航到此错误,我无法导航到下一个错误。
我的ts
文件
window.FirebasePlugin.verifyPhoneNumber(phoneNumber, 60, function (credential) {
console.log(credential);
let verificationId = credential.verificationId;
this.navCtrl.push(AuthDeviceVerifyPage, { verificationid: verificationId });
}
错误正在
[INFO:CONSOLE(309)] "Error in Success callbackId: FirebasePlugin1582498724 : TypeError: Cannot read property 'goToVerify' of null", source: file:///android_asset/www/cordova.js (309)
[INFO:CONSOLE(311)] "Uncaught TypeError: Cannot read property 'goToVerify' of null", source: file:///android_asset/www/cordova.js (311)
I / PhoneAuthProvider:Sms自动检索超时。 W / IInputConnectionWrapper:非活动InputConnection上的getExtractedText getTextBeforeCursor在非活动的InputConnection
上答案 0 :(得分:1)
我能够通过制作一个对象并使用该对象来解决这个问题。
// add a local variable to store navCtrl object
let thatNavCtrl = this.navCtrl;
window.FirebasePlugin.verifyPhoneNumber(phoneNumber, 60, function (credential) {
let verificationId = credential.verificationId;
thatNavCtrl.push(AuthDeviceVerifyPage, { verificationid: verificationId });
}, (error) => {
console.error(error);
});
}