📅  最后修改于: 2023-12-03 14:41:15.071000             🧑  作者: Mango
In the process of integrating your Flutter application with Facebook, you may need to generate a release key hash. This key hash is used by Facebook to authenticate your app and ensure that it's secured, especially when using Facebook Login or sharing features.
Here's how to generate a release key hash for your Flutter app:
First, you need to retrieve the SHA-1 fingerprint of the release keystore. You can do this by running the following command in your terminal:
keytool -exportcert -alias <your_key_alias> -keystore <path_to_your_keystore> | openssl sha1 -binary | openssl base64
Replace <your_key_alias>
with the alias used when creating your keystore, and <path_to_your_keystore>
with the file path of your keystore.
This command will prompt you to enter the keystore password. Enter it, and you'll get the SHA-1 fingerprint.
Now that you have the SHA-1 fingerprint, you can generate the release key hash using the following command:
echo -n <your_sha1_fingerprint> | openssl sha1 -binary | openssl base64
Replace <your_sha1_fingerprint>
with the SHA-1 fingerprint you retrieved in Step 1.
Finally, you need to add the key hash to your Facebook app settings. Log in to your Facebook developer account, go to your app dashboard, and navigate to the Settings > Basic page.
Scroll down to the Key Hashes section, and click on the Add Key Hash button. Enter the release key hash you generated in Step 2, and save your changes.
Your Flutter app is now ready to use Facebook's features securely!
Generating a release key hash can be a crucial step in integrating Facebook with your Flutter app. By following these steps, you can ensure that your app is secure and authenticated with Facebook.