cordova-plugin-firebase-authentication icon indicating copy to clipboard operation
cordova-plugin-firebase-authentication copied to clipboard

this.firebaseAuthentication.verifyPhoneNumber(...).then is not a function

Open hdung912 opened this issue 5 years ago • 18 comments

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);
});

}

hdung912 avatar Mar 28 '19 04:03 hdung912

did you get any solutions? i have facing the problem.

arghyaExicube avatar Apr 06 '19 11:04 arghyaExicube

same problem here

Drmorph avatar Apr 08 '19 17:04 Drmorph

Same issue

venkateshwaranks1996 avatar Apr 10 '19 16:04 venkateshwaranks1996

This error occurs to me when I'm debugging on browser.

On Android device it's running OK

lordonnance avatar Apr 30 '19 14:04 lordonnance

@Lordonnance This error occurs to me when I'm on debug and on release IOS

Drmorph avatar Apr 30 '19 16:04 Drmorph

I get the same but with createUserWithEmailAndPassword

ironbone avatar May 13 '19 13:05 ironbone

same problem...

mavilla-vishnu avatar Jun 04 '19 09:06 mavilla-vishnu

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.

uzbekjon avatar Jul 10 '19 13:07 uzbekjon

Doesn't make any difference. I'm running it on my device and still the same error. ERROR

Sagun085 avatar Aug 01 '19 11:08 Sagun085

@Sagun085 read the warning message above the error. Seems like you did not install the plugin.

uzbekjon avatar Aug 01 '19 12:08 uzbekjon

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!

errors

Sagun085 avatar Aug 01 '19 13:08 Sagun085

Same bug than @Sagun085 for me :(

qmonmert avatar Aug 12 '19 18:08 qmonmert

@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?

pkitatta avatar Sep 06 '19 10:09 pkitatta

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).

IngAjVillalon avatar May 10 '20 18:05 IngAjVillalon

still having the same error @IngAjVillalon can you please elaborate a bit how did you solved this issue ?

ahsan-alii avatar Jun 25 '20 07:06 ahsan-alii

@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?

DevNiklesh avatar Oct 06 '20 23:10 DevNiklesh

Ok, I'll make a demo and repository so It can help you.

IngAjVillalon avatar Oct 07 '20 00:10 IngAjVillalon

@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!

DevNiklesh avatar Oct 07 '20 00:10 DevNiklesh