react native with firebase phone auth validation failed

后端 未结 4 734
一整个雨季
一整个雨季 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: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.

提交回复
热议问题