i am using windows 7. trying to create new native android app.
to generate the key hash i wrote the following line in the cmd
C:\Program Files\Java\jre1.6.0_25\bin>keytool -exportcert -alias androiddebugkey
-keystore C:\Users\Youske.android\debug.keystore | C:\openssl\bin\openssl sha1
-binary | C:\openssl\bin\openssl base64
i enter the password : android
and i got my key hash : 0UzmruCvZLUgljxZvly3B34D7zA=
then i enable Configured for Android SSO: , then i copy this key to the "android key hash" texterea , click on save changes , and facebook generate to me the next error :
Error
You have enabled a Native Android App integration for your app, but have not specified the Android Key Hash. For security reasons, the Facebook application will not interact with any native application that does not have a signature that matches a corresponding key hash.
so if any one face this problem please help me.
I ran into this exact problem, and fixed it by simply using Firefox instead of Google Chrome. Hope this helps!
Related
I'm building an Ionic app that uses Firebase and Facebook to authenticate the user. I'm at the point where when I hit the login button on my app, the Facebook app tells me:
Invalid key hash. The key has <key_hash_here> does not match any stored key hashes. Configure your app...
I can't find any information at all on how this works.
Do I need just a hash in the Facebook dev console?
Do I need that same key also in the app somewhere, and if so, where would I put it in Ionic?
Do I need to do anything with Firebase at this point, I'm pretty sure I don't need to.
I used
keytool -exportcert -alias <RELEASE_KEY_ALIAS> -keystore <RELEASE_KEY_PATH> | openssl sha1 -binary | openssl base64
to create a key, substituting some name related to my app for <RELEASE_KEY_ALIAS> and "C:\" for <RELEASE_KEY_PATH>.
The command line returned a nice little hash, ending with "=", so it's doing it's job. I don't have an physical files it outputed.
I'm so confused as to if I need a physical file, and if so does it go in my app AND in the Facebook dev console.
Basically you want to use Facebook Auth in your Ionic App if i understand correctly
I would recommend to double check the process you did to add your key hash on the Official Documentation for Facebook Native on Ionic or in this external tutorial which is also well explained
If both fail try the following:
Delete any app on the website of Facebook (developers.facebook.com)
Delete the file debug.keystore
Generate a new hash key
Create a new app on developers.facebook.com and add the new hash key
Re-run your app
Success!
Hope it helps
I have went threw all the steps, creating a key hash for android for my game build in corona. For 2 days I'm trying to figure it out and it just doesn't work. Feelling kinda desperate. :( Here are my steps:
I have downloaded OPENSSL from Google in extracted it into C:\openssl
I have the latest version of Java which is in C:\Program Files\Java\jre7\bin
For testing I'm using the sample Facebook app provided with Corona. I have entered the AppId.
I create the keyhash using this command:
keytool -exportcert -alias androiddebugkey -keystore "C:\Users\tomaz.OXYLUS.android\debug.keystore" | "C:\OpenSSL\bin\openssl" sha1 -binary | "C:\OpenSSL\bin\openssl" base64
for password I enter android
then I paste the generated key in my facebook developer account under Native Android App\ Key Hashes
then I try to connect with the Corona Facebook app to Facebook, but it always says "loginCancelled". Also this error appears in the terminal window: W/fb4a:fb:OrcaServiceQueue(29191): com.facebook.orca.protocol.base.ApiException: Key hash EOw2r7Y4bNzFal-wFxLBGJQSxV8 does not match any stored key hashes.
What am I missing? I also tryed this procedure with the original game key. No succes. Please help.
I deleted the OpenSSL from Google website and installed this one http://slproweb.com/products/Win32OpenSSL.html, which I found on Facebook. Now everything is working just fine. Thank you for all your efforts Abhishek.
Have you tried to visit upload and register your apps in facebook developer? Before we can connect to facebook we need to register our application with the use of keyhash as identifier.
Once generate your key by code using the answer given in the link. Sometimes it returns different hash key . Chech the key in logcat and edit in Facebook app setting.Facebook Integration in Android Application
Well i am facing same issue...so i solved error like. When i use this "ionic cordova build android" coming error invalid key hash facebook android but this thing work on production app "ionic cordova build android --prod", i hope it help you...
I'm getting the following unexpected error from Facebook when I try to log in via my (emulated) Android app on Eclipse on OSX 10.9:
"This app has no Android key hashes configured. Configure your app key hashes at http://developer.facebook.com/apps/appID/"
Now on Facebook this app is in Sandbox mode. I've added my hash key to the "Sample App Settings" under the Developer settings.
I've generated this hash key with this command (like prescribed in the Getting started guide of Facebook):
MacBook-Pro:.android macbook$ keytool -exportcert -alias androiddebugkey -keystore /Users/macbook/.android/debug.keystore | openssl sha1 -binary | openssl base64
Enter keystore password: android
Why does Facebook still ask me for specific app key hashes, from an app that is still in sandbox mode? And how do I fix this? Is there something wrong with my keytool?
The "Sample App Settings" is only so that you can run the sample apps that ship with the SDK.
For your app, you need to add the key hashes to your app's "Native Android App" section.
See this doc for more details: https://developers.facebook.com/docs/android/getting-started/#create-app
an apology, actually I speak Spanish, and my English is very basic, I'm using Google translator, I hope you understand me.
I have an application that connects to the Facebook sdk, I've created my key hash using the example of Facebook, also I created a hash key using my keystore signed by the apk, and also I have that gives you using the Log.
The problem is when I run the application with the device connected to my pc, it gives me login to facebook without problems, but when I export the. Apk to test it on another device does not open the connection to facebook, just do not start session, I hope you can help me.
You Have to generate release key for facebook and add it on Facebook App developer console for that apps
Follow Below Steps:
Download openssl-for-windows from here
Now Open command propmpt(admin recommanded) provide jdk path .
C:\Windows\system32>cd "C:\Program Files\Java\jdk1.8.0_20\bin"
Use below command for generating key hash. You need path to release keystore and openssl bin.
keytool -exportcert -alias "enter alias name" -keystore "D:\mysapp.keystore" | "E:\Projects\facebook-android-sdk-3.6\openssl-0.9.8k_X64\bin\openssl" sha1 -binary | "E:\Projects\facebook-android-sdk-3.6\openssl-0.9.8k_X64\bin\openssl" base64
Enter release keystore password.
Enter Generated key in facebook app console.
Try this way for generating your key. If it is not work , try to generate your Facebook key by using your release key not your debug key. Hope this helps.
I'm having the problem "App is misconfigured" and I'm thinking the problem is the hash key.
I would to print for verify.
How can I show it in logcat without using Single Sign On but with LoginButton authentication?
Thanks.
I forgot to mention that I'm developing on Android.
perhaps you need to generate a hash key from your debug key store, and put it to your fb app config.
try to use the keytool:
keytool -exportcert -alias YOUR-ALIAS_HERE -keystore PATH_TO_YOUR_KEYSTORE -storepass KEYSTORE-PASSWORD -keypass KEY-PASSWORD | openssl sha1 -binary | openssl base64
for android debug keystore:
Alias: androiddebugkey
Both passwords: android
I finally solved!!! :D
I created a "test" project using SSO.
Linking old Facebook API it all works fine (using hash key generated with keytool) but, linking the new Facebook API 3.0.2 retrieve the error message "key mismatch".
Then, I copied the key show it in error message in dashboard and it all works!