baumblatt / capacitor-firebase-auth

Capacitor Firebase Authentication Plugin
MIT License
261 stars 129 forks source link

cfaSignInPhone: "auth/rejected-credential" #86

Closed maniksood closed 4 years ago

maniksood commented 4 years ago

I am getting the following error with the cfaSignInPhone implementation. (Tested on iOS Simulator)

{"code":"auth/rejected-credential","message":"Project number mismatch."}


import {cfaSignIn, cfaSignInPhoneOnCodeSent, cfaSignInPhoneOnCodeReceived, cfaSignInPhone} from 'capacitor-firebase-auth';

const phoneNumberString = '+91xxxxxxxxxx';
cfaSignInPhone(phoneNumberString).subscribe(user => console.log('user.phoneNumber',user.phoneNumber));

cfaSignInPhoneOnCodeSent().subscribe((verificationId) => {
    // suucessfully received the verificationId
    // saved the verificationId for future use
});

I am receiving the 6 digit OTP on the entered mobile number. After that I signin with the OTP using the code below

const credential = auth.PhoneAuthProvider.credential(verificationId, 'OTP_RECIVED_ON_MOBILE');

auth().signInWithCredential(credential).then(result => {
      console.log(result);
});

But I get the following error:

{"code":"auth/rejected-credential","message":"Project number mismatch."}