i am using the facebook native login and i get the CLOSED_LOGIN_FAILED .
The following is the LogCat i get in DDMS ,
02-22 15:16:22.939: E/excep
Use this piece of code because is more reliable, i tried many versions of openssl but with no success.
try {
PackageInfo info = getPackageManager().getPackageInfo("your.package",
PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
Log.d("YOURHASH KEY:",
Base64.encodeToString(md.digest(), Base64.DEFAULT));
}
} catch (NameNotFoundException e) {
} catch (NoSuchAlgorithmException e) {
}
paste it in onCreate
In addition to the above (correct) answers, I realized that when you do a 'release' build (EXPORT) as opposed to a 'debug' build (e.g - just build and run through Eclipse) - the build process uses a different key store. Which means that the hash code is different! I've been running the code above that gave me the hash key, I was able to connect and post, but none of my users were (because they installed from the STORE, which is built using the RELEASE key store!)
SO. Luckily Facebook allows multiple hashes. Pick your favorite method (either the code above or the SSL command line thing) and put BOTH keys in your Facebook admin for your app.
Checkpoint - to make sure you're 'safe' - make sure you have at least 2 keys over there and not just one. If you have one, it means that either your 'debug' builds will fail to connect, or your 'release' builds will.
I have also got stucked in the same issue and finally got a way around, the main reason behind the wrong Hash Key was the openssl, please download the openssl from here, i think facebook should provide a download link to openssl on their site so that people wont stuck in problems like this