Tuesday, April 17, 2012

Facebook Integration in Android application

When you are trying to integrate Facebook to add that social layer flavour to your android application, I'm more than sure that you would have followed instructions from here - http://developers.facebook.com/docs/mobile/android/build/

You should have come across  a point where you need to generate a hashed signature of the android application that needs FB integration and give it to FB during registration. You might have used the following:

keytool -exportcert -alias androiddebugkey -keystore 
<PATH TO YOUR APPLICATION KEYSTORE FILE> | openssl sha1 -binary 
| openssl base64

 
It will generate a signature and you will add it in the facebook registration page. But the thing is, it may not be the actual value that Facebook expects you to mention when you make a call to its API. It may give an error like "invalid_key" or "Facebook doesn't recognize your Android key hash". When you come across this error, then read the complete message. If you are not logging any error, then do log it. THE ERROR MESSAGE ITSELF CARRIES THE KEY. Use that key for registation (edit the details) instead of the one that is generated in the above 'keytool' command. It will resolve your issue.

Please comment if you like the post or in case, you have any queries.

Help me learn, Help you learn

KVK

No comments:

Post a Comment