Generate Key Hash For Facebook

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.

  1. Generate Key Hash For Facebook Free
  2. Generate Hash Online
  3. How To Generate Key Hash For Facebook

Today I am going to start my first post on Codepedia.info.

Overview:
  1. Nov 23, 2018 A) Faster way: Open Android Studio. Open your Project. Click on Gradle (From Right Side Panel, you will see Gradle Bar) Click on Refresh (Click on Refresh from Gradle Bar, you will see List Gradle scripts of your Project) Click on Your Project (Your Project Name from List (root)) Click on Tasks.
  2. Jun 24, 2014  Currently doing a small Facebook client for Android. There are several steps we need to do to get the integration working properly. Here I just give a brief of how to create Hash key to update in Facebook. I did a lot of research to get things working, so thought of writing a post that.
  3. Please note that you always use the following method inside onCreate of your android activity to get the key hash value(to register in developer.facebook.com site of your app) instead of using command line to generate hash value as command line in some cased may out put a wrong key hash.
  4. Jul 08, 2015 Generate a key hash for Facebook integration with android using openssl 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 explains how to generate `Android key hash` for FACEBOOK App and LINKEDIN App as in Login Authentication i.e. Facebook SDK integration to android require an key hash configuration same for LinkedIn App.

Android key hash facebook

So Are you working on Social Login ? From Android to LinkedIn App or Android to Facebook App? Whichever it may be you will need an android hash key facebook and package name to login using social elements.

I hope you all are familiar with android studio or eclipse and required java and SDK required to run an android application.

Let us start with the steps

  • Go to your `keytools` directory using command prompt.

Generate Key Hash For Facebook Free

Now what is keytools and where will you get it in your system.

What is Java Keytool ?

Java Keytool is a key and certificate management utility. It allows users to manage their own public/private key pairs and certificates. It also allows users to cache certificates.

Java Keytool stores the keys and certificates in what is called a Keystore. By default, the Java Keystore is implemented as a file.

It protects private keys with a password. A Keytool Keystore contains the private key and any certificates necessary to complete a chain of trust and establish the trustworthiness of the primary certificate.

[ads_468_60]

Where will you get or what is its directory?-

Generally Java folder is in C:/Program Files/then move inside that folder to jre6 or jre7. and then move to bin folder. To make things more clear i will post a image/screenshot of it.

  • Go to this directory and then enter the following command

Now after you enter the above code you may get the following error

Halo 2 pc key generator online. openssl is not recognized as an internal or external command

Below screenshot will make things more clear

Now this error may be because of two things

  1. OPENSSL path may be different.
  2. OPENSSL may not have been installed in your system.

For first error the solution is to change the path of OpenSSL for eg

C:Usersabcopensslbinopenssl.exe

and for second error the solution is you can download the

To download OPENSSL

Generate Hash Online

After you have downloaded the zip file. Just extract the file to you required path. Preferably (program files) for eg.

C:Program Filesopenssl

  • After this, you need to tweak the previous command in the command prompt a bit.

If you have saved the `OpenSSL` folder in example path

  • Then you will be asked for password

Enter android as password then you will get the hash key. And then use the hash key wherever you need.

Hope you enjoyed this tutorial. If you have any recommendations, please let us know what you think in the comment section below! See you again next time!

If You Liked It, could you do me a favour and tell your friends !! By sharing it on Facebook, Google+, Twitter.

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.

How To Generate Key Hash For Facebook

Generating a Keystore

Where:

<KEYSTORE_NAME> = the name of the keystore file to be generated
<ALIAS_NAME> = the alias of the keystore file

Prompts:

  1. Enter a password for the keystore.
  2. 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.
  3. Enter a password with which to protect the key. Press enter without input to assign the password used for the keystore.

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

To connect a keystore to a particular PhoneGap app follow these steps:

Firstly, ‘unlock’ the keystore you want to use:

  • 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.