Posts Tagged ‘facebook’

Hello Droids,

As we get error in applying Facebook SSO (Single Sign On ) feature in app, stating that,

“your application is miss-configured..” the problem is in generating the Hash key.

So lets generate the hash key from the application not from the console and use that hash key in Facebook app, which will configure your app with Facebook SSO 🙂

here is the code for that,

/** 
* Add this code to print out the key hash, and use that KeyHash
* 
*/
 try {
      PackageInfo info = getPackageManager().getPackageInfo(
      "com.myapp", PackageManager.GET_SIGNATURES);
      for (Signature signature : info.signatures) {
          MessageDigest md = MessageDigest.getInstance("SHA");
          md.update(signature.toByteArray());
          Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
      }
} catch (NameNotFoundException e) {

} catch (NoSuchAlgorithmException e) {

}
Advertisements

This is a sample app for integrating Facebook in android.

This will show you how to manage session(is session expired or not), how to handle it.

You are able to post on your own wall, with Title, Message, Link of app, Image and Properties of particular app.

You just have to provide your Facebook app id.

Here is the source code, Android Facebook Demo