Search code examples
firebaseflutterfirebase-authentication

Firebase phone authentication is not working on Android real device


I've been trying to achieve phone auth using Firebase authentication. It's working with an android emulator. I used a test number and a real number in the emulator. Both works. But only the test number is working with a real device and throwing this exception for other numbers

Error is:[firebase_auth/missing-client-identifier] This request is missing a valid app identifier, 
 meaning that neither SafetyNet checks nor reCAPTCHA checks succeeded. 
 Please try again, or check the logcat for more details.

I setup SHA key in firebase also.


Solution

  • I am guessing you have not enabled the Device Check API. All you need to do is enable the Device Check API on the cloud platform.

    I think after some updates they have made this change that for Safety Net you need SH1 Authentication along with enabling Device Check API.

    You can follow the Steps as mentioned here.

    Once you enable the device check api. Restart your application. It should work like a charm.

    Do lemme know if you need further steps.