cordova-plugin-firebase-authentication
cordova-plugin-firebase-authentication copied to clipboard
this.firebaseAuthentication.verifyPhoneNumber(...).then is not a function
Hi All i did try using plugin but when i try call verifyPhoneNumber i have issues like above signIn() { this.firebaseAuthentication.verifyPhoneNumber("+123123", 30000).then((verificationId) => {
console.log(verificationId);
});
}
did you get any solutions? i have facing the problem.
same problem here
Same issue
This error occurs to me when I'm debugging on browser.
On Android device it's running OK
@Lordonnance This error occurs to me when I'm on debug and on release IOS
I get the same but with createUserWithEmailAndPassword
same problem...
You will get this error in non-cordova environment such as browser (since this plugin does not have support for browser
). You should not see this error when you run your app on a device.
Doesn't make any difference. I'm running it on my device and still the same error.
@Sagun085 read the warning message above the error. Seems like you did not install the plugin.
Nice catch @uzbekjon Thanks, actually I was using the older version of cordova(8.0). After updating Cordova from 8 to 9.0.0 and installing the plugins:
$ ionic cordova plugin add cordova-plugin-firebase-authentication $ npm install @ionic-native/firebase-authentication
I could not build the app! it failed! tried multiple times!
Same bug than @Sagun085 for me :(
@Sagun085 same here. I get the error when I install the plugin, the error goes away when I remove the plugin. Did you get a work around?
That is not a problem in itself of the plugin, but of its development logic. Before executing any function of the plugin, you must be sure that cordova is running:
this.platform.ready().then(() => {
if(this.platform.is('hybrid')) {
this.firebaseAuthentication.verifyPhoneNumber(...)
.then(...)
}
});
I just made it work fine with no problem in Ionic 5. My application runs very well with the login with Phone, Google, and Facebook. It worked fine with Capacitor (v2) and Cordova (v9).
still having the same error @IngAjVillalon can you please elaborate a bit how did you solved this issue ?
@IngAjVillalon I'm working with ionic-capacitor and I'm not receiving phone verification sms after generating signed apk. Could you help me with it?
Ok, I'll make a demo and repository so It can help you.
@IngAjVillalon would love to see your demo!!... But I kinda solved the issue after scratching my head for 1 full day
To anyone facing similar issue like mine..
- Note that SHA-1 key must match both in your firebase project as well as APK signature!
How to check it? (Incase, you are a rookie like me😅)
- After generating Signed APK file.. open the key file using any keystore explorer software where you can find your SHA-1 key with which you had signed your app.
- Now, head on to your project in firebase -->Project settings.. where you can provide that generated SHA-1 key for Android app
Also remember that you will receive SMS only after uploading in Google Store.. in order to test your app provide your testing number in Authentication-->sign in methods-->phone authentication
Glad to help.. incase I'm wrong.. kindly correct me!