react native with firebase phone auth validation failed

后端 未结 4 743
一整个雨季
一整个雨季 2021-01-07 05:27

I\'m trying to make react native with firebase phone auth through react-native-firebase docs and I get this error

Error: This app is not authorized to us

相关标签:
4条回答
  • 2021-01-07 05:34

    If you use Android Studio you can connect Firebase to your account and set the dependencies automatically

    Tools -> Firebase -> Authentication -> Link:"Email and password authentication" -> Step 1 and 2 (And follow the link in Step 2)

    0 讨论(0)
  • 2021-01-07 05:36

    I know that sometimes is a little bit annoying go to step by step again, but normally is the better way to find the error.

    Don't know exactly the IDE that you are using, so I make this with android Studio, but you can copy to yours. Or import the Android project to do this in Android Studio

    First go to your firebase console and check your package name

    Now in Android Studio check if your package is really the same, inside AndroidManifest.xml

    If is not the same, you should change in firebase, even launch a new project

    Next step SHA-1

    You can use exactly this code (don't need to change) keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android

    In Android Studio open the Terminal (View > Tool Windows > Terminal) and Copy/Paste

    Copy the SHA-1 (suggest to save in some place)

    Go to Firebase console settings (click on the gear)

    Check the SHA-1

    download the google-services.json again.

    Put in the app folder (Delete the previous one) You can see this in android studio using the "project" view

    And what work for this question (copy from the question owner in a answer above)

    You need to generate SHA1 from android studio when you run the project!

    • Run your project.
    • Click on Gradle menu where it on right-hand side.
    • Expand Gradle Tasks tree.
    • Double click on android -> signingReport and you'll see the result

    For Android studio 2.2 - result will be available under Run console but use highlighted toggle button.

    0 讨论(0)
  • 2021-01-07 05:40

    If everything is correct

    • package name
    • SHA1 key
    • firebase configuration

    Certainly, that is because of the way you test.

    You have to run the app on a real device then try again.

    0 讨论(0)
  • 2021-01-07 05:51

    I found a solution you need to generate SHA1 from android studio when you run the project!

    1. Run your project.
    2. Click on Gradle menu.
    3. Expand Gradle Tasks tree.
    4. Double click on android -> signingReport and you'll see the result

    For Android studio 2.2 - result will be available under Run console but use highlighted toggle button.

    0 讨论(0)
提交回复
热议问题