Generate Key Hashes Manually
Key hashes are required for Facebook login to work with your application. Follow the steps below to create your development and release key hashes manually.
Windows#
This section will help you to create development and release key hashes for your application manually using a Command Prompt.
Generating a Development Key Hash#
Download openssl-for-windows openssl library for Windows from the Google Code Archive.
To generate a development key hash, run the following command in a command prompt in the Java SDK folder:
You need to replace the
USERNAMEfromC:\Users\USERNAME\.android\debug.keystorewith your user PC name.Replace the
PATH_TO_OPENSSL_LIBRARYfromPATH_TO_OPENSSL_LIBRARY\bin\opensslwith the path where you downloaded the openssl-for-windows.The password for debug key is
androidso when prompted for a password enter it.After successfully completing the step above, a debug key hash will be printed on the terminal.
ResultFrom your result copy the hashes which look like
BGXBgq/KmXXXXXXXXXXXXqOcmvg=this and save for later use. These hashes will be used in the android integration of Facebook Login.
note
You will need to provide a development key hash for the development environment of each person who works on your app.
Generating a Release Key Hash#
Android apps must be digitally signed with a release key before you can upload them to the store. To generate a hash of your release key follow the following steps:
Open a
terminalin android studio and paste the following commandFollow this if you have a
toolsdirectory in the root of your project. You will have a tools directory in the root folder of the project if you are using versionv1.5.6or above.With Tools DirectoryIt will prompt you for a password. The password for your release certificate is the password that you entered in
keystore-config.conffile in Editing Keystore Config File - Password.Follow this if you do not have a
toolsdirectory in the root of your project.Without Tools DirectoryReplace the
YOUR_RELEASE_KEY_ALIASwith the alias that you used while creating your keystore.Replace the
YOUR_RELEASE_KEY_PATHwith the full path to your release keystore which you have created.After editing your specific values, it should look something like this:
ExampleThe password for this is the same which you used while creating your release keystore.
After successfully completing the step above, a release key hash will be printed on the terminal.
ResultFrom your result copy the hashes which look like
BGXBgq/KmXXXXXXXXXXXXqOcmvg=this and save for later use. These hashes will be used in the android integration of Facebook Login.
Mac OS or Linux#
This section will help you to create development and release key hashes for your application manually using a Terminal.
Generating a Development Key Hash#
To generate a development key hash, open a terminal window and run the following command:
The password for debug key is
androidso when prompted for a password enter it.After successfully completing the step above, a debug key hash will be printed on the terminal.
ResultFrom your result copy the hashes which look like
BGXBgq/KmXXXXXXXXXXXXqOcmvg=this and save for later use. These hashes will be used in the android integration of Facebook Login.
note
You will need to provide a development key hash for the development environment of each person who works on your app.
Generating a Release Key Hash#
Android apps must be digitally signed with a release key before you can upload them to the store. To generate a hash of your release key follow the following steps:
Open a
terminalin android studio and paste the following commandFollow this if you have a
toolsdirectory in the root of your project. You will have a tools directory in the root folder of the project if you are using versionv1.5.6or above.With Tools DirectoryIt will prompt you for a password. The password for your release certificate is the password that you entered in
keystore-config.conffile in Editing Keystore Config File - Password.Follow this if you do not have a
toolsdirectory in the root of your project.Without Tools DirectoryReplace the
YOUR_RELEASE_KEY_ALIASwith the alias that you used while creating your keystore.Replace the
YOUR_RELEASE_KEY_PATHwith the full path to your release keystore which you have created.After editing your specific values, it should look something like this:
ExampleThe password for this is the same which you used while creating your release keystore.
After successfully completing the step above, a release key hash will be printed on the terminal.
ResultFrom your result copy the hashes which look like
BGXBgq/KmXXXXXXXXXXXXqOcmvg=this and save for later use. These hashes will be used in the android integration of Facebook Login.
You have successfully created the Key Hashes for your debug and release certificates. Now you can continue to follow the guide from where you came here to create key hashes manually.