Ad

Invalid Phone Number In Cordova-plugin-firebase

I'm trying to use cordova-plugin-firebase for phone authentication in an ionic project running the project on an android real device. But recently I faced an issue that complain about invalid phone number, however, it was working just few weeks ago. Here is the codes :

 signIn() {

// add a local variable to store navCtrl object

let thatNavCtrl = this.navCtrl;

//Step 1 — Pass the mobile number for verification



window.FirebasePlugin.verifyPhoneNumber('+93794737444', 60, function (credential) {

  let verificationId = credential.verificationId;

  //This is STEP 2 — passing verification ID to verify Page

  thatNavCtrl.push(VerifyPhonePage, { verificationid: verificationId, phone: tell });

}, (error) => {

  console.error(error);

});

and this is the screen shot of error: enter image description here

Let me know if you need something else for figuring the problem out.

Ad

Answer

After hours of searching in project, I figured out the problem myself, it was because I didn't add my SH-1 key on Firebase console. Something that is bizarre for me is while reading the error it never complained about authentication of SH-1 key.

Ad
source: stackoverflow.com
Ad