0

Hy! I tried to integrate the facebook sdk with my android app. I obtain my key kashes using this comand:

keytool -exportcert -alias androiddebugkey -keystore "C:\Documents and Settings\Administrator.android\debug.keystore" | "C:\OpenSSL\bin\openssl" sha1 -binary |"C:\OpenSSL\bin\openssl" base64

After that I, i create a new facebook application, where i selected native android app and i give my hashkey. enter image description here

But when I run the app, I receive this error: enter image description here

Can someone to help me?

Nistor Alexandru
  • 5,309
  • 9
  • 46
  • 71
  • did you check this : http://stackoverflow.com/questions/16767672/key-hash-doesnt-match-while-facebook-login-in-android – Arash GM Oct 21 '13 at 13:07

1 Answers1

1

Try this when session open

try {
            PackageInfo info = getPackageManager().getPackageInfo("YOUR_PACKAGE_NAME", 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) {

        }
Gajendra Rawat
  • 3,673
  • 2
  • 19
  • 36