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.
#
WindowsThis section will help you to create development and release key hashes for your application manually using a Command Prompt
.
#
Generating a Development Key HashDownload 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
USERNAME
fromC:\Users\USERNAME\.android\debug.keystore
with your user PC name.Replace the
PATH_TO_OPENSSL_LIBRARY
fromPATH_TO_OPENSSL_LIBRARY\bin\openssl
with the path where you downloaded the openssl-for-windows.The password for debug key is
android
so 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 HashAndroid 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
terminal
in android studio and paste the following commandFollow this if you have a
tools
directory 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.6
or 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.conf
file in Editing Keystore Config File - Password.Follow this if you do not have a
tools
directory in the root of your project.Without Tools DirectoryReplace the
YOUR_RELEASE_KEY_ALIAS
with the alias that you used while creating your keystore.Replace the
YOUR_RELEASE_KEY_PATH
with 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 LinuxThis section will help you to create development and release key hashes for your application manually using a Terminal
.
#
Generating a Development Key HashTo generate a development key hash, open a terminal window and run the following command:
The password for debug key is
android
so 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 HashAndroid 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
terminal
in android studio and paste the following commandFollow this if you have a
tools
directory 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.6
or 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.conf
file in Editing Keystore Config File - Password.Follow this if you do not have a
tools
directory in the root of your project.Without Tools DirectoryReplace the
YOUR_RELEASE_KEY_ALIAS
with the alias that you used while creating your keystore.Replace the
YOUR_RELEASE_KEY_PATH
with 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.