inficare
inficare

Reputation: 3

Facebook Integration in Android Application

I had integrated facebook in my android application . Generate key using debugkeytool and it works fine on both emulator and real device.

Now i have to make release apk file and i had created keystore using eclipse android tool to export signed application package .

And using this keystore i had generated new key hash for facebook and set it on facebook developers site. but still i am not able to post on facebook wall after signing my app with my own created keystore. I had check all the steps for creating keystore and it is correct.

please help me out of this situation.

Thanks

Upvotes: 0

Views: 4213

Answers (1)

Abhishek Agarwal
Abhishek Agarwal

Reputation: 1897

I got the same error but when i checked the hash key by PackageManager i got the different hash key of the application and update it on facebook and it worked for me.

 PackageInfo info;
    try {
        info = getPackageManager().getPackageInfo("com.example.yourpackagename", PackageManager.GET_SIGNATURES);
        for (Signature signature : info.signatures) {
            MessageDigest md;
            md = MessageDigest.getInstance("SHA");
            md.update(signature.toByteArray());
            String something = new String(Base64.encode(md.digest(), 0));
            //String something = new String(Base64.encodeBytes(md.digest()));
            Log.e("hash key", something);
        }
    } catch (NameNotFoundException e1) {
        Log.e("name not found", e1.toString());
    } catch (NoSuchAlgorithmException e) {
        Log.e("no such an algorithm", e.toString());
    } catch (Exception e) {
        Log.e("exception", e.toString());
    }

change your package name in the code. The hash key will be printed in the log. It may help you.

Upvotes: 8

Related Questions