I attempted to implement phone authentication using Firebase and Angular. I set up the reCAPTCHA verifier and phone number, and then passed it to the firebase.auth.signInWithPhoneNumber() function. However, the function only returned the verification Id and not the verification code, and it also did not send an SMS to my number.
onSignInSubmit(phoneNumber) {
this.recaptcha = new firebase.auth.RecaptchaVerifier('recaptcha-container', {
'size' : 'invisible',
'callback': function(response) {
// reCAPTCHA solved, allow signInWithPhoneNumber.
}
});
this.afauth.auth.signInWithPhoneNumber(phoneNumber, this.recaptcha).then((confirmationResult) => {
console.log(confirmationResult);
});
}