I have problem about login with facebook acount in my application. I read to Facebook Doc. And I did all step as Facebook Doc.
First in login with facebook acount in app - SUCCESSFUL ! and than logout in application. I want to login again with my facebook acount. But not working !! And I took this Excepiton ! Please help me !
Exception : This app has no Android Key hashes configured.Configure your app key hashes at http:developers.facebook.com/apps/"APP ID"
Finaly; I used to part of code for HashKey Genarate
try {
PackageInfo info = getPackageManager().getPackageInfo("MY 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);
// Toast.makeText(getApplicationContext(),sign, Toast.LENGTH_LONG).show();
}
} catch (NameNotFoundException e) {
} catch (NoSuchAlgorithmException e) {
}
I resolved my issue. I should have done setting on Facebook. Steps :
- Go to facebook developer's page : https://developers.facebook.com/
Open the App tabs and than click the Setting
Paste the generate hashkey on HashKey's field = If you don't have it yet, get your key hash part of code
- And than Single Sign On will be "Yes" : Single Sign On: Enable this setting.
I wanted to share my resolve. Maybe someone need this solution. Good Luck !