Get sms verification code sent to user in javascript sent from Firebase signInWithPhoneNumber function

277 Views Asked by At

below piece of code works perfectly fine

 // Initialize Firebase
  var config = {
    apiKey: "muykjkjgh........",
    authDomain: "my-project.firebaseapp.com",
    databaseURL: "https://my-project.firebaseio.com/",
    projectId: "my-project",
    storageBucket: "my-project.firebaseio.com",
    messagingSenderId: "8235......"
  };
  firebase.initializeApp(config);
  
  window.recaptchaVerifier = new firebase.auth.RecaptchaVerifier('verify', {
      'size': 'invisible',
      'callback': function(response) {
     }
    });
    firebase.auth().signInWithPhoneNumber("+911234567890", window.recaptchaVerifier) 
  .then(function(confirmationResult) {
    window.confirmationResult = confirmationResult;
    //I want to achieve 6 digit code sent to users mobile number
    //log doesnt show 
    console.log(confirmationResult);
  });
  };

As above code I have commented is there a way to extract a 6 digit code sent to user mobile number

0

There are 0 best solutions below