Table of Contents

How to implement the Facebook login button?

← All Topics

Requirements

You need to have generated your key hash before following this tutorial, if you have not already done so, follow these steps: https://appzmotion.com/help-center/getting-facebook-key-hash/.

Steps

  1. Go to your Facebook Developer Consoles following this link: https://developers.facebook.com/apps/.
  2. Click Add a New App.
  3. Enter Display Name of our app, Contact Email and click on Create App ID.
  4. Click Se Up Facebook Login.
  5. Select Android.
  6. In the Android implementation tutorial, skip steps 1 and 2 by clicking the Next button.
  7. In the step 3, enter your app Package Name and Default Activity Class Name (you can put com.example.yourappname.MainActivity), then click on Save and Continue buttons.
  8. After click on Continue button, a popup will display, click on Use this package name.
  9. In step 4, paste your Key Hashes and click Save and Continue.
  10. In the step 5, enable Single Sign On, then click Save and Next buttons.
  11. Skip steps 6, 7, 8, 9 and 10 by clicking the Next button.
  12. Go to Settings -> Basic from left side menu and copy your App ID. If you wish you can also complete the information of your application here.
  13. Go to your Android Studio project -> res -> values -> strings.xml and replace your Facebook App ID and your Facebook Login Protocol Scheme (this is the same as your App ID but with “fb” at the beginning. Example: facebook App ID: 54756432134568, then the FB Login Protocol Scheme is fb54756432134568) at the bottom.
Support