How to Provide Key Hashes for Your Android App to Facebook Developer Platform : Flutter
If you’re integrating Facebook Login or other Facebook-related features into your mobile app, you’ll need to provide key hashes to Facebook Developers.
These key hashes are used to ensure the security of your app’s communication with Facebook’s servers.
This guide is a follow up to the User Authentication Tutorial over on Youtube.
In this guide, I’ll walk you through the process of generating and providing the key hash for your Android app.
Understanding Key Hashes
Key hashes are cryptographic signatures of your app’s signing certificate. They serve as a security measure to validate that the app communicating with Facebook is indeed the one you’ve registered.
Generating SHA1 Fingerprint
- Open your terminal or command prompt.
- Navigate to your app’s Android project directory.
cd android
3. Next let’s generate the SHA1 fingerprint certificate. There are 3 ways to do this:
a) Using Play App Signing
b) Keytool or
Run the following command to generate the development key hash using the Gradle signingReport.
./gradlew signingReport
This will print out a report for 3 variants of Task:app:signingReport
: debug, release and profile referring to the 3 types of build modes in Flutter. Pick from your preferred mode.
> Task :app:signingReport
Variant: XXXXXXX
Config: XXXXXXX
Store: XXXXXXX
Alias: XXXXXXX
MD5: XXXXXXX
SHA1: XXXXXXX
SHA-256: XXXXXXX
Valid until: XXXXXX
Generate Key Hash using SHA1
To do this:
- Navigate to tomeko.net
2. Enter the SHA1 fingerprint on Hex string Textfield
3. Click Convert.
4. You’ll get the key hash in the Output textfield.
Providing Key Hash to Facebook Developer Platform
- Open your web browser and go to the Facebook Developers website.
- Log in with your developer account and navigate to your app’s dashboard.
- In the left sidebar, click on “Settings” under the “Basic” section.
4. Scroll down. If you do not have an “Android” section, click on Add platform.
5. Select “Android” platform and click on “Next”
6. Select “Android Store” or skip by clicking on “Next”
7. The Android section will be displayed and there will be a Textfield to insert the “Key Hash”
8. Copy and paste the key hash we generated.
9. Click Save changes.
Conclusion
Providing key hashes for your Android app to Facebook Developer Platform is a crucial step to ensure the security and functionality of Facebook-related features within your app. By following the steps outlined in this guide, you can seamlessly integrate Facebook features while maintaining the integrity of your app’s communication with Facebook’s servers.
Remember to keep your key hashes safe and avoid sharing them in publicly accessible locations. Properly securing your key hashes is an essential aspect of protecting your app and its users.
👏🏽 👏🏽 Give this story CLAPS
👉🏽 Subscribe for upcoming articles
💰 Access Free Mobile Development tutorials
🔔 Follow for more
See you on next article 👋