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,
Use this for print key hash in kotlin
try {
val info = context.getPackageManager().getPackageInfo(context.packageName,
PackageManager.GET_SIGNATURES);
for (signature in info.signatures) {
val md = MessageDigest.getInstance("SHA")
md.update(signature.toByteArray())
Log.d("Key hash ", android.util.Base64.encodeToString(md.digest(), android.util.Base64.DEFAULT))
}
}catch (e:Exception){
}