Create a Facebook client
To use Facebook as an Identity Provider, visit the Facebook for Developers page, and follow these steps:
-
Click the Create App button.
-
Select Consumer for app type, and click Next.
-
Enter your app’s display name and contact email.
-
Click the Create app button.
-
On the Add products to your app page, under Facebook Login, click Set up.
-
In the left navigation panel, click Settings > Basic.
-
Take note of the App ID and App secret values.
Generate a key hash
The default password for Android Studio is android
.
-
To generate a key hash value, in a terminal window, enter the following command:
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
-
Note the key hash value for later use.
Configure an Android app
-
On the developer apps page, double-click an Android app.
-
In the left navigation panel, select Settings > Basic.
-
At the bottom of the page, click Add platform, select Android, and click Next.
-
In the Select Android Store dialog, select a store.
For example, Google Play.
-
Click Next.
-
Scroll down to the Android section.
-
In the Key hashes field, enter the key hash value you generated earlier.
-
In the Package Names field, enter your app’s Google Play Package Name.
The name is often a reverse domain name, such as
com.example.app
. -
In the Class Name field, enter your app’s class name.
-
Click Save changes.
Configure an iOS app
-
On the developer apps page, select iOS.
-
Click Next.
-
Enter your Bundle ID.
The name is often a reverse domain name, such as
com.example.app
. -
Click Save changes.
-
In the left navigation panel, under Facebook Login, select Quickstart.
-
Click iOS.
-
Read the information, and select your package manager.
-
Click Next.
-
Enter your Bundle ID.
-
Click Save.
-
Click Continue.
-
Select your single sign-on settings.
-
When you get to Configure Your info.plist, configure your
info.plist
file with the XML snippet that contains data for your app.