I can't get my app to allow Facebook login. Everytime the users tries to login to Facebook and authenticate my app with their FB, it gives me this error:
Invalid key hash. They key hash xxxxxxxxxx= does not match any stored key hashes. configure your app key hashes at http://developers.facebook.com/apps/xxxxxxxx
I've already tried creating a new key hash through the OpenSSL tool like so:
keytool -exportcert -alias androiddebugkey -keystore debug.keystore | openssl sha1 -binary | openssl base64
Doing this gives me a key hash, which I then add into the 'Key Hashes' list on the developer page for the app. I then use ionic to rebuild the app, and when I run it on my android phone it gives the same error. There is another version of the app that was built on another computer, and a different hash key was used, and that worked perfectly, but the hash key from this computer doesn't seem to want to work. Any help would be great
Go to the Facebook Developer site. Log into Facebook and, using the dropdown menu in the top-right, go to Developer Settings: In your developer settings, select Sample App from the menu, and add and save your key hash into your profile: You can add multiple key hashes if you develop with multiple machines.
keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | openssl sha1 -binary | openssl base64
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
The password is android.
Also see the Ionic docs for more info.
Following steps solved my problem
Go to facebook account inside settings > Apps and Websites > Logged in with Facebook > Active > click on ur app > And Remove App
After doing that try to login now and this time you will get facebook error code 1349195 : something like go to facebook docs/android page and do the setting
Now run the command from yours teminal
keytool -list -printcert -jarfile yourapkname.apk
Copy the SHA1 value and convert that into base64 and paste that base64 value into you facebook account and then try login.
To convert sha1 to base64, you can use http://tomeko.net/online_tools/hex_to_base64.php
He had the same problem. My solution:
On ubuntu:
keytool -exportcert -alias androiddebugkey -keystore /home/"username"/.android/debug.keystore | openssl sha1 -binary | openssl base64
(replaces your "username")
Now you need to enter password, Password = android
I hope that helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With