I am trying to build an android app with Facebook login. The app runs successfully on the emulator. But every time I install and run the app on an Android device and tries to login I get the error as in the following screenshot:
Asked
Active
Viewed 73 times
3
-
http://stackoverflow.com/q/20301025/235710 – Adil Shaikh Feb 13 '14 at 18:52
1 Answers
0
Your Facebook application should have key hashes that are valid to the keystore you are using the following code:
try {
PackageInfo info = getPackageManager().getPackageInfo(
"com.yourpackage.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) {
}
or follow this link instructions Facebook Android Generate Key Hash
Then add this generated key hash to the keyhashes in android settings in your Facebook application

Community
- 1
- 1

Ahmed Zayed
- 2,165
- 1
- 20
- 21