I download Hackbook example from git then, I create and run project. It show that Login failed: invalid_key(I didn't change anything) So, I try create my new own app and add Hash key that i got from keytool to facebook app setting (Android Native App) Then, I change this new Facebook("My_own_APP_ID");
It works!
The question:
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
when i ask for hash key ?Go to your Facebook App --> Settings--> Paste Hash key in "key hashes" option -->save changes. Now Test your android app with Facebook Log-in/Share etc.
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.
The answer based on my experience
Do I need to add new key hash every time I change development computer(In case, there are many collaborators, Do they need to change Facebook_APP_ID everytime ?
You don't need to change Facebook_APP_ID everytime. Once you created facebook app, you can add multiple key hash to it. If you have many collaborators, get keyhash from them and add the keyhash to your facebook app.
In case, I wanna launch this app to market. Do I need to change this keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64 when i ask for hash key ?
Yes. You replace ~/.android/debug.keystore
with your own publishing keystore and again add that keyhash to facebook app.
Another alternative,
if you don't want to add a lot of keyhash to facebook app, you can always use one common debug key to sign your android app for all collaborators.
But of course, don't share your publishing key to everyone.
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