无法在Facebook上分享 [英] Unable to share on Facebook

查看:316
本文介绍了无法在Facebook上分享的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经集成的Facebook SDK 到我的项目。我已经遵循的https://developers.facebook.com/docs/android/getting-started/facebook-sdk-for-android/

I have integrated Facebook SDK into my project. I have followed all the steps mentioned in https://developers.facebook.com/docs/android/getting-started/facebook-sdk-for-android/ .

但后来也我不能够在Facebook上分享。
我已经产生使用 debug.keystore 的哈希,并把它放在两个地方,如文档中提及。

But then also I am not able to share on facebook. I have generated the hash using debug.keystore and have placed it at 2 places as mentioned in the documentation.

问题:我能够在Facebook上共享如果Facebook的原生Android应用程序未安装在设备中。即通过弹出这要求电子邮件ID和密码。我不知道是什么原因如果已安装Facebook应用程序不共享。

Issue: I am able to share on facebook if native facebook android app is not installed in the device. i.e. via the pop up which ask for email id and password. I don't know why it doesn't share if facebook app is installed.

编辑:均匀我下载了最新的样品和Facebook的SDK其中的https:/ /developers.facebook.com/android/ 提供。此外,还有我这个面临同样的问题。即使我试过很多设备。

Even I downloaded the latest samples and sdk of Facebook which https://developers.facebook.com/android/ provides. There also I faced this same issue. Even I tried in many device.

推荐答案

我能现在有了这个进行。问题是与我,包括Facebook开发的网站密钥散列。我正由于OpenSSL的错键。我通过包括这块code的正确的:

I am able to Proceed with this now. The issue was with key hash which I was including in facebook developers site. I was getting wrong key due to openssl. I got the correct one by including this piece of code:

try {
    PackageInfo info = getPackageManager().getPackageInfo(
          YOUR_PACKAGE_NAME, PackageManager.GET_SIGNATURES);
    for (Signature signature : info.signatures) 
        {
           MessageDigest md = MessageDigest.getInstance("SHA");
           md.update(signature.toByteArray());
           Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
        }
    }
} catch (NameNotFoundException e) {
} catch (NoSuchAlgorithmException e) {
}

我得到这个,而我正在寻找替代生成密钥的哈希值。

I got this while I was searching for alternative to generate the key hash.

这篇关于无法在Facebook上分享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆