Why should we call FirebaseAuth verifyPhoneNumber in onStart?

Viewed 33

The documentation for Firebase phone-number-authentication says that,

After you call verifyPhoneNumber, set a flag that indicates verification is in progress. Then, save the flag in your Activity's onSaveInstanceState method and restore the flag in onRestoreInstanceState. Finally, in your Activity's onStart method, check if verification is already in progress, and if so, call verifyPhoneNumber again.

But, I'm not getting why we should call the method again if verification is already in progress. Few lines above, they themselves mentioned that, verifyPhoneNumber is reentrant, and will not send a second SMS until timeout. So, if verification is already in progress, why bother calling method again?

Also, what is the use of PhoneAuthProvider.ForceResendingToken in onCodeSent callback?

0 Answers
Related