Firebase Authentication Error : The SMS code has expired. Please re-send the verification code to try again

Hi all,

I try to switch any other app or just press the home button in the middle of the process is going on (or going to copy code from message app), Even if the OTP is correct, it is showing error “The SMS code has expired. Please re-send the verification code to try again.”

when I try to login second time, I am not getting any code sms for the same number.

how to resend otp on request from the number?

My code is here,

phoneAuth() {

    this.firebaseAuthentication.verifyPhoneNumber("+91"+this.phone, 30000).then((verificationID) => {
      
      this.verificationID = verificationID;

    }).catch((error) => {
      console.log(error,"err")
    });

  }

  signInWithCode(){
    
    this.firebaseAuthentication.signInWithVerificationId(this.verificationID,this.code).then((user)=>{
      console.log(user,"user")
    }).catch((error) => {
      console.log(error)
    });
  }

Thank you