Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Key Hash for Facebook with Cordova

I'm developing a hybrid app with Meteor and Cordova. I'm trying to configure Facebook Connect and got it working on iOS but I'm stuck on android. I cannot seem to find the correct key hash. I always get the message:

Invalid key hash. The key hash ... does not match any stored key hashes.

I already tried to find the correct key hash via the following command:

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

and the standard password "android". I added the resulting key to Facebook but it didn't help. I also tried the tool in the following post. It gave me another key which also did not work. Any ideas?

like image 242
Ravest Avatar asked Mar 09 '15 11:03

Ravest


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.

What is key hash in Android?

You will have to enter a password. The password is: android. A code will come up and that code is your key hash.


2 Answers

Meteor uses its own debug keystore when creating an android app via meteor run android-device. The keystore can be found at ~/.meteor/android_bundle/.android/debug.keystore.

Use the following code and the keystore password android for creating your keyhash:

keytool -exportcert -alias androiddebugkey -keystore \
~/.meteor/android_bundle/.android/debug.keystore | openssl sha1 -binary | openssl base64
like image 187
Sebastian Rehm Avatar answered Nov 14 '22 23:11

Sebastian Rehm


I went through the same problem and simply had to put the key which was on the error message on FB settings. It worked.

like image 34
Pierrick Martellière Avatar answered Nov 14 '22 22:11

Pierrick Martellière