My app uses a simple facebook login. I have entered the keyhash in my app dashboard, key_hash section and I was able to login successfully. Now I have published the app and
If you are facing this problem then put this key into your developer.facebook.com
Then make sure your app is live on developer.facebook.com
This green circle is indicating the app is live
If it is not then follow this two steps for make your app live
Step 1 Go to your application -> setting and add Contact Email then apply save Changes
Setp 2 Then goto Status&Review option and make sure this toggle is Yes i added a screen shot
Try generating new keyhash using your app's keystore file used for signing the published app. This problem may be caused by providing the keyhash generated by your debug keystore which will only work with unsigned apk files. please refer the step 5 of following link to understand how to generate a keyhash https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/
and update the same with app settings page of facebook.
Also check whether your package name and class name are correct.
You need to to a keyhash from your debug.keystore or if you signed it with release key, than with that. Make sure, that your alias-name is also correct. That has an effect at your keyhash.
Check this out: How to create a Facebook key hash?
For example, the key provided in the error is "rX6qeRitkFCWui3de74rxB_qc1s", then the list of hash code in Facebook, you try and put this code at the end of the end "=" getting rX6qeRitkFCWui3de74rxB_qc1s= and see if it worked.
Here is the C# version for the benefit of anyone trying to get the Xamarin sample to work.
public void showHashKey(Context context)
{
try {
PackageInfo info = context.PackageManager.GetPackageInfo("com.facebook.samples.hellofacebook", PackageInfoFlags.Signatures);
foreach (Android.Content.PM.Signature signature in info.Signatures) {
MessageDigest md = MessageDigest.GetInstance("SHA");
md.Update(signature.ToByteArray());
var sign = Base64.EncodeToString(md.Digest(), Base64Flags.Default);
Log.Info("KeyHash:", sign);
}
Log..Info("KeyHash:", "****------------***");
} catch (PackageManager.NameNotFoundException e) {
e.PrintStackTrace();
} catch (NoSuchAlgorithmException e) {
e.PrintStackTrace();
}
}
You can generate a hash key through coding, you simply do one thing. Paste this code in main class (first class) then run the app and check the logcat where you will find the hash key.
One more thing, replace this package name "com.example.creeper" with your package name:
try{
PackageInfo info = getPackageManager().getPackageInfo(
"com.example.creeper", 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) {
}