Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting invalid android_key parameter error, after first time login in Facebook Android SDK

I have got the hash key from my debug store using

keytool -exportcert -alias androiddebugkey -keystore C:\Users\user.android\debug.keystore | openssl sha1 -binary | openssl enc -a -e

and pasted the key to Facebook App for Android and also enabled "Facebook Login" option.

When I first time log into my Android App, it shows me a permission dialog and after giving the permission, I am enable to get me details from Facebook.

But after that when i exit and the app and again open and try to login, it shows below screen.

I don't get this, if hash key is the issues, then why it works in first attempt.

I am using facebook sdk old version not the new 3.+ version.

Error when attempting second login

like image 640
Adil Bhatty Avatar asked May 08 '13 07:05

Adil Bhatty


1 Answers

Solved the issues, added permission of "offline_access" and also the Hashkey should match the key which appears in error. Use "Key Hash" apk available at Easy Facebook SDK website, install it on phone to get the HASH KEY or use KEYTOOL plugin to get the SHA1 of your keystore and then convert it to base64 from here. and add this key to your register project.. :) Hope this helps @Pratick

like image 74
Adil Bhatty Avatar answered Nov 12 '22 18:11

Adil Bhatty