Sign in with Facebook (SHA in APK)

If you have already compiled your App, and at the moment of testing your APK it
does not log in to Facebook, you must follow these steps. You must check that this
step is already done:

  • Enable Log in with Facebook in Firebase

You must enter Log into Facebook and select your app

Click on Quick Login > Android

You’ll click on “Next” until you get Option 3: Inform us about your Android project

You’ll go back to your Firebase account > Settings > General > Your apps

You’ll copy the name of the package

Go back to Facebook (Name of the package) and you’ll paste the code you just
copied. In “Name of default activity class” you’ll type: MainActivity, and you’ll save
and click on Continue.

You must go to your firebase console: Settings > General > Your apps, and then copy
the SHA-1 key (SHA certificate fingerprints)

Enter the page: https://hash-facebook.apphive.io/ and paste the SHA-1 there, and
send. You must copy the key that it will give you, and then go back to Facebook
Developers.

Go back to Facebook, in Option 4: Add the development key hashes and activation,
you must add the hash of your app.

When adding, you must skip the remaining steps. You’ll go back to Settings > Basic

Here, you must validate that all the information requested is registered, the URL for

Privacy Policy and Service Conditions is essential. As well as the 1024x1024 logo.

Once all the information is added, you must enable the switch that currently says: In
development to Published, and, after this, your Facebook App will be enabled in APK
format.

You must go to Firebase > Authentication > Sign-in method

Now, copy the URL and go back to your Facebook console

In the Facebook Developers console > OAuth Client Settings, and you must paste
the URL in the marked section and click on Save

How to add another app to the same account?

If you have other apps that use Facebook Login within your project, you must upload
them to the same account. You mustn’t create a different Facebook ID per app, it’s
just one per project. To sign up for another app, follow these steps:

From your Facebook Developers dashboard, go to Settings > Basic

In the lower part (Android) you’ll find the name of the Google Play and Key Hashes
package, there, you’ll add the information of the new app and save the changes.

When your app is loaded to stores, you must follow another process.