Phone Auth auto verification not working in Flutter Firebase

132

Your issue is similar to the one listed below, without additional details (IE: code examples) there is no way to have a definite solution.

But based on the limited information provided, you have to ensure that you have the setCallbacks setup with your OnVerificationStateChangedCallbacks handler as indicated here.

Another thing to note is this can be automatically done in two ways

This callback will be invoked in two situations:

1 - Instant verification. In some cases, the phone number can be instantly verified without needing to send or enter a verification code.

2 - Auto-retrieval. On some devices, Google Play services can automatically detect the incoming verification SMS and perform verification without user action.

So ensure that the Google Play service is running on the device to allow this to occur. (Note the "On some devices")

https://stackoverflow.com/a/53809370/5779200

Share:
132
Mohit Singh
Author by

Mohit Singh

Updated on January 03, 2023

Comments

  • Mohit Singh
    Mohit Singh over 1 year

    I am using firebase's phone auth in a flutter app. Everything works fine but auto verification of OTP is not working. User has to manually input the OTP. Looking on the web, it seemed like APP_NAME in %LOGIN_CODE% is your verification code for %APP_NAME%. must be shorter for it to work.

    Currently, it is <my_project_id>.firebaseapp.com. I have enabled Device Verification on GCP and followed all the steps in the documentation. I have also published the app on playstore under internal testing and it has been reviewed but APP_NAME has still not updated.

    What do I need to update this and is it going to make OTP auto-verification work?