I am a lot of time try to connect my android app with facebook but get excaption with the hash key. I read question here about this but didn succes to solve my problem
I run this code to get hash key
try {
PackageInfo info = getPackageManager().getPackageInfo(
"com.example.fishe",
PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
Log.d("com.example.fishe", Base64.encodeToString(md.digest(), Base64.DEFAULT));
}
} catch (NameNotFoundException e) {
} catch (NoSuchAlgorithmException e) {
}
And it show me 12-12 14:19:29.615: D/com.example.fishe(5834): 5C440zhVwrb0ZQTs325My+VLZBo=
Now when I run the app and try to log in I get exception : (now the hash is with '-' instead of '+')
12-12 14:16:30.105: E/(5834): com.facebook.FacebookAuthorizationException: UnknownError: Key hash 5C440zhVwrb0ZQTs325My-VLZBo does not match any stored key hashes.
I try to insert to app - >edit setting ->native android app in https://developers.facebook.com first time the hash key with '+' and secondt time with '-' . Both times with the '=' at the end. I got the ecxception in both cases... What to do?