Generate Key Hash For Facebook Android
Mar 19, 2014 Hi Guys, I'm using Facebook official SDK into a Unity game for Android. According to the FB documentation, I can see the debug key hash when I go to Facebook - Edit Settings. I've added this key hash into the app developer page on Facebook. It works fine when I build the android apk unsigned. Jul 08, 2015 Facebook uses the key hash to authenticate interactions between your app and the Facebook app. If you run apps that use Facebook Login, you need to add your Android development key hash to your Facebook developer profile. This article share the process of generating a key hash for Facebook integration with android using openssl. Nov 24, 2018 This will generate a hash key that must be placed into app's profile. Scroll down to Android Key Hashes; Place the key there; Source. This is what Facebook requires get the generated hash '.= ' and copy the key hash to your Facebook developers app settings. What possible location can be for OSX? Apr 06, 2020 It even shows up empty on my device where Facebook sign in works. I also wait until the Facebook SDK is initialized before updating my display text with the key hash. I'm trying to get the key hash from the Facebook C# SDK's FB.Android.KeyHash property, but it's always an empty string. Any ideas on what is going on? Setting a Release Key Hash. To authenticate the exchange of information between your app and the Facebook, you need to generate a release key hash and add this to the Android settings within your Facebook App ID. Without this, your Facebook integration may not work properly when you release your app to the store.
If you are receiving errors regarding an incorrect key hash when attempting to configure your PhoneGap application for use with the native Facebook Connect plugin (com.phonegap.plugins.facebookconnect) then we hope this guide will help you. Although aimed at PhoneGap applications in particular, the use of keystores and key hashes extends outward to all applications, whether written natively or not.
Any line breaks within the following commands should be ignored and are included for presentation purposes only.
Prerequisites
- OpenSSL (download here for Windows) (pre-packaged with OS X) – if you are running a 64-bit machine, make sure to grab the 64-bit binaries (x64).
- keytool – this is packaged as part of Java (download here)
- PhoneGap Facebook Connect plugin is configured correctly within your app’s codebase. This includes: adding the plugin to your local plugins repository, configuring the plugin with the necessary App ID and App Name values within config.xml, invoking somewhere the Facebook Login prompt from within your app by calling facebookConnectPlugin#login, and declaring the facebookConnectPlugin.js file as a script within index.html.
Generating a Keystore
Where:
<KEYSTORE_NAME> = the name of the keystore file to be generated
<ALIAS_NAME> = the alias of the keystore file
Prompts:
- Enter a password for the keystore.
- You will be asked for details such as your first and last name, the name of your organisation, etc. These details are not mandatory and can be left as ‘Unknown’, the default value assigned on pressing enter without input.
- Enter a password with which to protect the key. Press enter without input to assign the password used for the keystore.
/file-scavenger-license-key-generator.html. The keystore file <KEYSTORE_NAME> will be saved to the local directory unless you explicitly specified a different location.
Retrieving Key Hash from a Keystore
This command will yield a 28 character hash. Use this in your Facebook app’s Settings page, as seen below:
Submitting Key Hash to a Facebook App
Copy and paste the hash that was generated from the last command and place it within the Key Hashes input:
Submit Keystore to PhoneGap
To add a keystore to your PhoneGap account follow these steps:
- Log in to PhoneGap at build.phonegap.com
- Go to build.phonegap.com/people/edit
- Click on the Signing Keys tab
- Under the relevant device select ‘add a key…’
- Give the key a title (this can be anything)
- Input the alias of the keystore as defined by the <ALIAS_NAME> parameter in the above commands
- Choose the file from your filesystem and press ‘submit key’
Add a Keystore to an App
Generate Key Hash For Facebook Android App
To connect a keystore to a particular PhoneGap app follow these steps:
Firstly, ‘unlock’ the keystore you want to use:
Generate Key Hash For Facebook Android Free
- Go to build.phonegap.com/people/edit
- Click on the Signing Keys tab
- On the right of the keystore press the yellow padlock
- Enter the certificate password
- Enter the keystore password
- Press ‘submit key‘
Secondly, add this key to the app:
- Go to build.phonegap.com/apps and select an app by clicking its name
- Select a keystore from the dropdown menu next the Android icon (as in the image below)
- Press Rebuild to compile your app using the new keystore
– Sam
If you found this helpful and are interested to find out more about the projects we work on, look at joining our team or just want a cup of tea, leave a comment or email us, we’d love to talk to you.