Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate Key Hash for facebook SDK In Mac

I'm trying to obtain the key hash for integrating facebook into my Android app. But all over the net I can't find the way to do it on MAC OS X, only for Windows.

If someone could light me with the proper way to obtain the key hash I'd really appreciate it.

Thank you!

like image 968
ady Avatar asked Jul 12 '11 09:07

ady


People also ask

How do I configure APP key hashes on Facebook?

Steps : Go to facebook developer's page : https://developers.facebook.com/ Open the App tabs and than click the Setting. Paste the generate hashkey on HashKey's field = If you don't have it yet, get your key hash part of code.


Video Answer


2 Answers

I used following steps to generate a Key Hash for my app in facebook: (I am using Mac OSX 10.8)

  1. First open a terminal (open a command prompt in windows).
  2. Navigate in the terminal to the directory where your Android debug.keystore is stored.
  3. Mostly it will located under “/Users/user_name/.android/” (In Windows will be C:\Documents and Settings\.android).
  4. Once you are in the “.android” directory, run the following command.

    keytool -exportcert -alias androiddebugkey -keystore debug.keystore | openssl sha1 -binary | openssl base64

  5. When it prompts you for a password, type android and hit Enter

  6. Copy the value printed in the terminal that ends with an “=” and paste it in the Key Hash field in Facebook. Then click the Save Changes button.

Reference: Integrate Facebook logins in your Android app

like image 51
Arun G Avatar answered Sep 23 '22 14:09

Arun G


Please follow below steps to find debug.keystore and generate key hash for android development at mac.

  1. Open terminal

  2. Type cd ~/.android and hit enter to go to .android directory

  3. If you want to open .android directory in finder, type open . and hit enter. Then .android directory will be opened in finder where you can find debug.keystore. If you do not want to open .android directory and only want to generate key hash, then skip this point and follow #4.

  4. In terminal where you are already in .android directory type

    keytool -exportcert -alias alias_name -keystore sample_keystore.keystore | openssl sha1 -binary | openssl base64

    and hit enter.

  5. You are asked for password. Enter android as password and hit enter. Then you get key hash ending with "="

  6. Copy key hash,enter in your facebook app setting page and save changes.

like image 44
Santosh Prasad Sah Avatar answered Sep 25 '22 14:09

Santosh Prasad Sah