1. Help Center
  2. PassionFighters' Corner

Key hash for Android app

Hello, PassionFighters!

 

Connecting your Android (Google) app to your Facebook developer account will allow you to create ads that convert and give direct access to your end-users (total win-win!). At some point, Facebook will ask you for the "Key hash", and you will find how to generate yours in this article.

 

Why is the key hash needed? According to Facebook, it's necessary to authenticate the exchange of information between your app and Facebook. You need to generate a release key hash and add this to the Android settings within your Facebook App ID. Without this, your Facebook integration may not work properly when you release your app to the store. You will see that it's easier that it seems!

 

Step by step process (here is the source): 

1. Open your Google Developer Console

2. Select your app

3. On the left menu, scroll down a little bit and click on "App integrity"

 

This is how it looks for our BBX app, but it will look very similar for your own app: 

 

mceclip0.png

 

4. Open this link in another tab https://base64.guru/converter/encode/hex

5. Paste that SHA-1 code (circled in the image) in the first box that you will see when you open the previous link, and then click on "Convert Hex to Base64"

7. The key hash you need will appear in the box underneath, as you can see in this scheme:

Captura_de_pantalla_2021-09-14_103045.jpg

 

Copy and paste this Key Hash into your Facebook App ID's Android settings, which should look like this:

 

mceclip1.png

 

In that box, please keep in mind that:

Class Name is always: com.whitelabel.MainActivity

Package Name is your Android bundle id, which you see in the main page of your Google Developer Console. Here is how it looks in one of our accounts: 

 

Captura_de_pantalla_2021-09-14_104053.jpg

 

You can also find the package name after the symbol "=" in the link to your app in the Google Play Store, as you can see here:

Captura_de_pantalla_2021-09-14_104259.jpg

 

Now you are ready to run automated ad campaigns in Facebook with your Google app, congratulations!!!