3.6 Facebook Login Setup for Android
Last updated
Last updated
Now you have set up Facebook sign-in. To do that, Go to this URL.
Go to My apps > Create App.
Enter the App name and email and go to the Dashboard tab.
For the next step, you need to generate two hash ids. To do that, run the following commands on the terminal.
Scroll down on the right panel until you reach ‘Add a product’, select Facebook Login
You will be redirected to the quick start page.
Select Android. Skip 1 & 2.
Enter your_package_name in the package option and enter your_package_name.MainActivity in the activity option.
Use android as a debug password. After that, you will get a hash id like this.
For the release hash id, run the following command by replacing your alias key name and Keystore location. You can get these from your android/key.properties file.
After that, you will get another hash id. Now, copy and paste them into the next steps of the Facebook developer site. Like this,
Skip all the steps by clicking next.
Now go to the settings tab & copy both the app id and app secret key.
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.
Now go to android/app/src/main/res/values/strings.xml file and change the facebook_app_id and facebook_client_token.
You will get the Facebook client token from https://developers.facebook.com/ > Your_app > Settings > Advance tab.