I have built a \"Log In with Facebook\" button for my app, it\'s working normally in the virtual device, but after I built my app to apk and test it on the real device, ther
We have to add total three key hashes at Facebook developer.
1.using package manager in android app.
try {
PackageInfo info = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);
for (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);
//textInstructionsOrLink = (TextView)findViewById(R.id.textstring);
//textInstructionsOrLink.setText(sign);
Toast.makeText(getApplicationContext(), sign, Toast.LENGTH_LONG).show();
}
} catch (PackageManager.NameNotFoundException e) {
Log.d("nope", "nope");
} catch (NoSuchAlgorithmException e) {
}
2.Debug key using command line
keytool -exportcert -alias androiddebugkey -keystore C:\Users\username\.android\debug.keystore | C:\openssl-0.9.8k_X64\bin\openssl sha1 -binary | C:\openssl-0.9.8k_X64\bin\openssl base64
3.Release key using command line
keytool -exportcert -alias app_alias -keystore C:\Users\usename\app_keysrore.jks | C:\openssl-0.9.8k_X64\bin\openssl sha1 -binary | C:\openssl-0.9.8k_X64\bin\openssl base64
please add this all key hashes and check again.
Note :