Note : Before you start,
– You must register a verified business in facebook developer portal to use facebook login feature. As our app uses email and public_profile information to login via facebook, facebook requires verified business to make the facebook login app live.
Here is how to verify business
– For android users, providing package name is required now. You need to publish your app in play store once before adding facebook login. After you publish, you’ll be able to enter package name and Class name. Otherwise, facebook will throw error. If your package name is “com.myapp”, your class name will be “com.myapp.MainActivity”
Facebook Login #
- Go to https://developers.facebook.com/ and login with your facebook id.
- From the top menu click on “My Apps”.
- Now Click “Create App > Consumer > Continue” .
- Now give a display name for your app & press “Create App”. Facebook might ask for password here.
- After providing facebook password, your app will be crated and you’ll be taken to the dashboard.
- Now, from the side bar menu click “Settings > Basic” .
- Now provide privacy policy, Terms and conditions and data deletion callback URL. You may also upload an icon here in dashboard.
Now save everything by clicking “Save changes” button at the bottom of the screen.
Now press the App Mode toggle button and make the mode Live. You’ll find it at the top bar.
Now again save everything by clicking “Save changes” button at the bottom of the screen.
At this point, You may or may not see a “Data usage checkup” notification. If you see it, just click on it and complete data usage checkup. If you do not see it, it’ll be visible later and you must complete data usage checkup. Facebook login might not work without completing data usage checkup. It takes up to three days to show up data usage check up notification sometimes. - Now go to Settings > Basic and Scroll to bottom and click “+ Add Platform” and select [ios] or [Android].
Android
a. After selecting android, select google play store from the drop down list and press next.
b. Under the field “Key Hashes” field, first paste this value (without quotes) “rRW++LUjmZZ+58EbN5DVhGAnkX4=”. This hash is for expo go environment. This is only for development and testing the app in expo go. When you publish the app in play store, you can remove this hash.
c. Remember, you must build your app once before performing this step.
Runeas credentialsand select the profile that you would like to generate the SHA-1 Fingerprint for, and press enter.
Take the resulting SHA1 Fingerprint and convert it to base64 (for example, using base64.guru). The resulting base64 string is your “Facebook Key Hash”. Put it in facebook app under “Key Hashes”
d. **Important Step** The key hashes you’ve provide in step a & c are for development stage only. When you publish your app in play store, these hash will not work. To get new hash , go to this link https://play.google.com/console/. Login to your play console account and select your published app. On the next page select “App Integrity” under “Setup” option from the sidebar. You’ll see something like the image below. Copy the “SHA-1 certificate fingerprint” under “App signing key certificate”. Go to this link and paste the copied hex key and press “convert”. You’ll get output in base64 format. Now copy this base64 value and paste it in the field “Key Hashes” and remove the previous values.

- iOS
a. Select iOS and press next.
b. Provide “Bundle ID” . You’ll get this from app.json file under “ios” > “bundleidentifier” . It’ll look like com.appname.domain.
8. Now scroll to top and provide the Privacy policy URL and User Data Deletion URL.
9. Now press “Save Changes”.
10. Now run command “npx expo install react-native-fbsdk-next@13.4.1“npx expo install react-native-fbsdk-next@13.4.1
11. Open screens > LoginScreen.jsx and remove “//” from code. See image below:
12. Open App.js file and remove the “//” from the following lines
13. Now open app.json file and add the following codes under expo > plugins
Put your app id, display name and client token here.
You’ll get client token from facebook app Settings > Advanced > Security > Client token{
"expo":{
....
"plugins":[
[
"react-native-fbsdk-next",
{
"appID": "8789769768768",
"clientToken": "h875rhg875gbrfyrdv7b5rb78jht87",
"displayName": "Homlisti",
"advertiserIDCollectionEnabled": false,
"autoLogAppEventsEnabled": false,
"isAutoInitEnabled": true }
],
....
]
....
}
}

12. Open “app > services > socialLoginConfig.js”.
13. Under socialConfig, change the value of “enabled” from “false” to “true”.(see below image)
14. Add the value “facebook” under “socialPlatforms” array (e.g. “socialPlatforms” : [ ”facebook” ] ). (see below image)

– After configuring FB Login, please create a new build and test with that. Older build will produce errors.