I\'m working on an Android app, in which I want to integrate a Facebook posting feature. I downloaded the Facebook-Android SDK, and I got the readme.md (text file) in there,
try this :
1) get hash key from using command line (Official Doc : https://developers.facebook.com/docs/android/getting-started)
keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | openssl sha1 -binary | openssl
base64
OR
2) get hash key using code
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Hask Kay generation
GetKeyHase();
}
private void GetKeyHase() {
try {
PackageInfo info = getPackageManager().getPackageInfo("ADD YOUR PACKAGE NAME", PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = (MessageDigest.getInstance("SHA"));
md.update(signature.toByteArray());
String hashkey_value = new String(Base64.encode(md.digest(), 0));
Log.e("hash key", hashkey_value);
//check you logcat hash key value
}
}catch (Exception e) {
Log.e("exception", e.toString());
}
}