Android Facebook Key Hashes Configuration

665 Views Asked by At

I m getting Error "This app ha no key hashes configured."

where i have configured key hashes as shown in below image:enter image description here

plz guide me, thanx in advance.

1

There are 1 best solutions below

3
Dinesh On

For every machine, the hash key may be different. You need to include new fresh key.

To get the hash key , use the following code

 try {
        PackageInfo info =     getPackageManager().getPackageInfo("YOUR PACKAGE NAME",     PackageManager.GET_SIGNATURES);
        for (android.content.pm.Signature signature : info.signatures) {
            MessageDigest md = MessageDigest.getInstance("SHA");
            md.update(signature.toByteArray());
            String sign=Base64.encodeToString(md.digest(), Base64.DEFAULT);
            Log.e("MY KEY HASH:", sign);

        }
} catch (NameNotFoundException e) {
} catch (NoSuchAlgorithmException e) {
}