在Android应用程序Facebook的整合 [英] Facebook Integration in Android Application
问题描述
我曾在我的Android应用程序集成的Facebook。 生成使用debugkeytool键,它工作正常在两个模拟器和真实设备。
I had integrated facebook in my android application . Generate key using debugkeytool and it works fine on both emulator and real device.
现在我必须做出释放apk文件,我不得不使用eclipse的android工具创建密钥库 导出签名的应用程序包。
Now i have to make release apk file and i had created keystore using eclipse android tool to export signed application package .
和使用该密钥库我已经产生了新的密钥散列为Facebook和Facebook开发者网站设置。 但还是我不能够签下我自己创建密钥库我的应用程序后,张贴在Facebook上墙。 我检查所有的步骤创建密钥库,这是正确的。
And using this keystore i had generated new key hash for facebook and set it on facebook developers site. but still i am not able to post on facebook wall after signing my app with my own created keystore. I had check all the steps for creating keystore and it is correct.
请帮我摆脱这种局面。
感谢
推荐答案
我得到了同样的错误,但是当我通过检查哈希键 PackageManager 我得到了应用程序的不同哈希键和更新在Facebook和它为我工作。
I got the same error but when i checked the hash key by PackageManager i got the different hash key of the application and update it on facebook and it worked for me.
PackageInfo info;
try {
info = getPackageManager().getPackageInfo("com.example.yourpackagename", PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md;
md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
String something = new String(Base64.encode(md.digest(), 0));
//String something = new String(Base64.encodeBytes(md.digest()));
Log.e("hash key", something);
}
} catch (NameNotFoundException e1) {
Log.e("name not found", e1.toString());
} catch (NoSuchAlgorithmException e) {
Log.e("no such an algorithm", e.toString());
} catch (Exception e) {
Log.e("exception", e.toString());
}
更改code你的包名。散列键将被打印在日志中。 它可以帮助你。
change your package name in the code. The hash key will be printed in the log. It may help you.
这篇关于在Android应用程序Facebook的整合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!