问题
In Firebase SMS Authentication for Android, I'm trying to debug the stage in which the user has to type in the Verification Code he received via SMS.
However, due to the Instant Verification, I cannot recreate this scenario on my phone anymore because the onCodeSent()
event is never called again. The onVerificationCompleted()
is called instead - which is GOOD for production, but it leaves me no option to debug my SMS Code Verification screen.
Unfortunately, at the moment there is no way to disable Instant Verification (waiting for @samtstern's response)...
How can I recreate that scenario again? at least for debugging?
This answer didn't help because we can't get the ForceResendingToken
without triggering the onCodeSent(..)
, and as I said, I can't get it triggered...
回答1:
Closing this question since @samtstern has responded to me on Github, providing an alternate workaround due to the (current) lack of feature to disable Instant Verification:
That's a good point. I'll make sure to add that to the feature request internally. One workaround is to use two devices. On one device (with no SIM) enter the phone number of the other device (with a SIM). Then you'll get the code flow.
回答2:
Disabling and re-enabling the sim from settings will skip Instant verification until the next successful OTP verification.
来源:https://stackoverflow.com/questions/44974802/instant-verification-prevents-oncodesent-to-ever-be-called-debugged-fireba