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:Usersusername.androiddebug.keystore | C:openssl-0.9.8k_X64inopenssl sha1 -binary | C:openssl-0.9.8k_X64inopenssl base64
3.Release key using command line
keytool -exportcert -alias app_alias -keystore C:Usersusenameapp_keysrore.jks | C:openssl-0.9.8k_X64inopenssl sha1 -binary | C:openssl-0.9.8k_X64inopenssl base64
please add this all key hashes and check again.
Note :
- You have to generate all these keys on the same machine which is
used to sign an APK using key store.
- We have to add two debug key hashes because key produced by package
manager and command line are different.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…