-
Notifications
You must be signed in to change notification settings - Fork 4k
🐛 [ui] Entering OTP on Android does not work AuthStateChangeAction SignedIn does not fire #7826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Did you add the phone number to testing as mentioned here? If so, you won't receive the OTP, instead you use the code listed for the testing numbers. |
@richard457 |
@pr-Mais yes I did and as mentioned on the web AuthStateChangeAction is able to fire when state changes but on mobile (android) it does nothing. @darshankawar I added the testing number in firebase authentication. @pr-Mais emulator is running of cause! that's where I am testing my app. |
Also would be nice to have errors shown on android. |
@richard457 so the number you're using for testing is added in the Firebase Console? in this case you will never receive any OTP, you use the OTP you setup with your test number on the console. |
yes I know, I use the otp I set from firebase, this is the behavior as mentioned on the web AuthStateChangeAction SignedIn is able to fire when state changes but on android after entering otp it does nothing @pr-Mais I mentioned this in the above comments too. |
Could you please provide a reproducible sample code? |
I am using the sample code you provided in flutterfire_ui and if you need a testing phone is +250 783 054 002 and OTP is 123456 |
Have you uninstalled the app and cleared cache? |
yes I did using adb uninstall |
I see some logs saying you didn't set the signing certificate SHA-1, it's a required step for Phone authentication, make sure to follow the steps here to add it. |
you are right on your sample code did not add the sha1, but adding it does not solve the issue @pr-Mais |
you are right on your sample code did not add the SHA-1, but adding it does not solve the issue @pr-Mais I triple checked and in console, no other error showed this is what happened, after putting the OTP the browser opened for captcha and after confirming I am not a robot it closed, the SignedIn did not fire, attempt to click again |
@richard457 |
Are you using your own Firebase options or the ones that comes with the example app? |
Tried both, using my own and replacing them with my own. |
hello everyone, here is my finding, the widget is not easy to drop to an existing app somehow it assumes for example to use one sing page for auth, you can not have
on one screen and
on another screen this will throw errors, also if it is not put directly under MaterialApp it is going to throw an error too, even the top parent widget is a material... I think this is a limitation since you can not use it under for example a scaffold. then somehow I managed to get the OTP sent on the device could not tell what was different except a few things I tried that has nothing to do with the package, I believe there is something that is not well. overall the package is not in best state to be used as it is not predictable and would love to followup on this. |
The quick assumption is that it is okay to separate these screens and only go to the OTP verification screen once you got it, but NAH, it does not work, the only way you can somehow get the code to work is to use your sample code as it is, no other way around |
These sample can be useful, a sample that separates these screen MaterialApp->PhoneInPutScreen->SMSCodeInputScreen (NOTE that these screens are not in one widget) and also very important to wrap PhoneInPutScreen or SMSCodeInputScreen with whatever widget of choice, and if the root MaterialApp has some settings should be applied too for example |
for example this code will not work
|
cc @lesnitsky |
@lesnitsky any update about this issue? |
The above code throws this error when clicking on phone login.
|
|
fixed in #9343 |
Run the flutterfire/packages/flutterfire_ui/example app on the android simulator, try to log in using a phone number wait for the OTP and it does not come.

The text was updated successfully, but these errors were encountered: