title: The sms code has expired. Please re-send the verification code to try again
body: <p>Whenever I tried to login with phone number using react-native-firebase sdk, I recieve OTP code through sms and when I submit the recieved code, an error is there saying:"The sms code has expired. Please re-send the verification code to try again." And here point to be noted that an entry for respective phone number is writing in Users section of firebase even there is an error.</p>
  
  <p>I am using following:</p>
  
  <pre><code>NodeJS: v8.11.1,
  NPM: v5.6.0,
  react-native: "^0.59.9",
  react-native-firebase: "^5.5.3"
  </code></pre>
  
  <p>Some links I have already tried are:</p>
  
  <pre><code>1. https://github.com/invertase/react-native-firebase- 
  docs/blob/master/docs/auth/phone-auth.md
  2. https://stackoverflow.com/questions/46522726/firebase-phone- 
  authentication-error-the-sms-code-has-expired
  3. https://www.bountysource.com/issues/45308170-firebase-phone- 
  number-auth-integration
  4. https://medium.com/@chrisbianca/getting-started-with-firebase- 
  authentication-on-react-native-a1ed3d2d6d91
  5. https://invertase.io/oss/react-native-firebase/v6/auth/phone- 
  auth
  </code></pre>
  
  <p>In MobileRegistration.js:</p>
  
  <pre><code>navigateToOtpScreen() {
  console.log("Phone number: ", "+91" + this.state.phoneNumber)
  firebase.auth().signInWithPhoneNumber("+91" + 
  this.state.phoneNumber)
  .then(confirmResult =&gt; {
     this.setState({ confirmResult, message: 'Code has been sent!'})
     this.props.navigation.navigate('EnterOtp', { 'confirmResult': 
     confirmResult})
   })
   .catch(error =&gt; {
        alert(error.message);
        this.setState({ message: `Sign In With Phone Number Error: 
        ${error.message}` })
    });
  </code></pre>
  
  <p>};</p>
  
  <p>In EnterOtp.js:</p>
  
  <pre><code>componentDidMount() {
  this.unsubscribe = firebase.auth().onAuthStateChanged((user) =&gt; {
      alert(JSON.stringify(user));
      if (user) {
          this.setState({
              user: user.toJSON()
          });
      } else {
          // User has been signed out, reset the state
          this.setState({
              user: null,
              message: '',
              otp: '',
              otp1: '',
              otp2: '',
              otp3: '',
              otp4: '',
              otp5: '',
              otp6: ''
  
          });
      }
  });
  </code></pre>
  
  <p>}</p>
  
  <pre><code>componentWillUnmount() {
  if (this.unsubscribe) this.unsubscribe();
  </code></pre>
  
  <p>}</p>
  
  <pre><code>verifyOTP = async () =&gt; {
  const {
      confirmResult,
  } = this.props.navigation.state.params;
  let otp = this.state.otp + "" + this.state.otp1 + "" + this.state.otp2 + "" + this.state.otp3 + "" + this.state.otp4 + "" + this.state.otp5 + "" + this.state.otp6
  if (confirmResult &amp;&amp; otp.length) {
  
      alert(otp);
      confirmResult.confirm(otp).then((user) =&gt; {
              AsyncStorage.setItem('accessToken', confirmResult._verificationId);
              this.props.navigation.navigate('SetupCoverVideo');
              this.setState({
                  message: 'Code Confirmed!'
              });
          })
          .catch(error =&gt; {
              alert(error.message) &amp;&amp; this.setState({
                  message: `Code Confirm Error: ${error.message}`
              })
          });
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Expected Result: Code should be verified and an entry should be in Users  section of firebase and navigate to SetupCoverVideo.</p>
  
  <p>Actual Result: Facing an error saying: "The sms code has expired. Please re-send the verification code to try again." And here point to be noted that an entry for respective phone number is writing in Users section of firebase even there is an error.</p>
  
  <p>I am wondering for the solution. Anyone please assist me.</p>