Reputation: 115
I have recently got Facebook to work when debugging my application by following the insructions on facebooks developer page on how to export and get the hash key we need to put in the developer portal.
So now this is done, i tried using facebook log in with a exported and signed version of my application. Unfortunately i was not able to get it to work. It would never return a log in session after logging in through the facebook app or web page.
I believe this is due to the keys being difference between the released and signed apk and the apk i use to debug.
Anyone know how to fix this problem?
Upvotes: 6
Views: 5020
Reputation: 981
Copy Paste the SHA1 key to the link.
Internally its converting Hex to Base64.
We can convert from this Website directly.
Upvotes: 0
Reputation: 826
In order to generate the key Please follow the steps provided above. the main problem you can face will be alias as it'll throw exception: keytool error: unable to find alias (likely). if you have signed key to release the app fetch alias of that key using:
keytool -list -keystore
Now use this alias in keytool -exportcert -alias -keystore c:\openssl\bin\debug.txt
Now you can follow the steps mentioned in the previous comment.
Upvotes: 0
Reputation: 27748
You are correct on the key hash's being different from the debug.keystore and the release signing key. To remedy that, follow the steps on this website here: http://www.helloandroid.com/tutorials/using-facebook-sdk-android-development-part-1
It has a nice tutorial that will fix the issue in almost no time.
The gist of it is:
C:\Program Files\Java\jre7\bin
openssl sha1 -binary debug.txt > debug_sha.txt
And then,
openssl base64 -in debug_sha.txt > debug_base64.txt
Done! The debug_base64.txt contains your Key Hash. Copy this in your app console and you are all set.
This sounds lengthy, but you really will be done in literally 4 - 5 minutes. ;-)
Upvotes: 9