# 3.6 Facebook Login  Setup for Android

* Now you have set up Facebook sign-in. To do that, Go to this ​[URL](https://developers.facebook.com/).​
* Go to My apps > Create App.
* Enter the App name and email and go to the Dashboard tab.

<figure><img src="https://lh4.googleusercontent.com/LZUrxaeFyo1FH1a7Cwy3_FdkY20WJ4PaC_y8H2eKnHja_J_nOzECN9NAFtD1T_s_bp1Kx_Tr615AEt2NHjUCn63KOo8cTwbjEMXu6s763SLuvTcfVfdh0BG4fRbi033EYPXxVXDmZsBGtW2umCVsYH5mb3cVfeVRI4aLm9KPaOLACcCHsPBJB064-RE8" alt=""><figcaption></figcaption></figure>

> For the next step, you need to generate two hash ids. To do that, run the following commands on the terminal.

1. Scroll down on the right panel until you reach ‘Add a product’, select **Facebook Login**&#x20;
2. You will be redirected to the quick start page.
3. Select **Android**. Skip 1 & 2.
4. Enter **your\_package\_name** in the package option and enter **your\_package\_name.MainActivity​** in the activity option.

{% tabs %}
{% tab title="Mac" %}

```
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
```

{% endtab %}

{% tab title="WIndows" %}

```
keytool -exportcert -alias androiddebugkey -keystore "C:\Users\USERNAME\.android\debug.keystore" | "PATH_TO_OPENSSL_LIBRARY\bin\openssl" sha1 -binary | "PATH_TO_OPENSSL_LIBRARY\bin\openssl" base64
```

{% endtab %}
{% endtabs %}

1. Use ​**android**​ as a debug password. After that, you will get a hash id like this.

<figure><img src="https://lh4.googleusercontent.com/VGAPLDNgDz1kC1o3e_qhHwQJ3bJGOVRJlsVASR5fjBLKOLF3lQT6BKjiiO9CRsVOimtnUZC6M-txuD4RNg3-RE1Ti-2XX2jKs6Y_HVNQk3ZZxsr4TPX5He8BG7UfTKcexA7zrVFPLFg8usv4kT6S1KVB4R4FvDeo_Yvvb4LMXbGBck8APFs8glMbRNbF" alt=""><figcaption></figcaption></figure>

1. For the **release hash id**, run the following command by replacing your **alias key** name and **Keystore location**. You can get these from your **a​ndroid/key.properties** ​file.

```
keytool -exportcert -alias YOUR_RELEASE_KEY_ALIAS -keystore YOUR_RELEASE_KEY_PATH | openssl sha1 -binary | openssl base64
```

1. After that, you will get another **hash id**. Now, copy and paste them into the next steps of the Facebook developer site. Like this,

<figure><img src="https://lh5.googleusercontent.com/mJQCQrssuY0MhConK4o64otgSH-3h-FQmQMcPrtNuUqB6Zks3WqstSgPl6ax-_XIcoYJ7AZs6edqbDX7SI4pvZnVUJTsCBQ-zE57FNYHBnSNYXbPvfr_5r6N5EgtEbH_ix4SsU2xKguQddAEGCQNDDBWChkSm0l3Jj43ZCYzPLNhoLygLdLj0gq8qK3T" alt=""><figcaption></figcaption></figure>

1. Skip all the steps by clicking next.
2. Now go to the settings tab & copy both the **app id** and **app secret key**.
3. Now go to firebase console > your project > authentication > Sign-in-method and click on Facebook, enable it and paste both **app id** and **app secret key** and save it.
4. Now go to ​**android/app/src/main/res/values/strings.xml** file​ and change the **facebook\_app\_id** and **facebook\_client\_token**.

<figure><img src="https://lh5.googleusercontent.com/UxZOD8g90c4Y0QQkPdfU__zk03ESq9WGxojaxg7fNjGj6f24Lyyil0SGmnr5589hKBhXijfs5bIbLMXWk5ozqXsICFmPBRbYPFqk6V8pAZIgIMBVQ5GO1_cx_UeOFMMQQwv0jn-tKfmvcs5h2xz6P5hYMPKz_SF8FsmTGnJPpBShchtCyZCA5a1QICSC" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
You will get the **Facebook client token** from  <https://developers.facebook.com/> > Your\_app > Settings > Advance tab.
{% endhint %}
