Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android facebook:无法共享您的链接_Android_Facebook - Fatal编程技术网

Android facebook:无法共享您的链接

Android facebook:无法共享您的链接,android,facebook,Android,Facebook,我添加了使用android的共享意图共享我的应用程序中的分数的功能: Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND); shareIntent.setType("text/plain"); shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "My Score"); shareIntent.putExtra(android.content.In

我添加了使用android的共享意图共享我的应用程序中的分数的功能:

Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "My Score");
shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "I scored "+score+" on "+difficultyString+" difficulty.");

context.startActivity(Intent.createChooser(shareIntent, "Share your score"));

当我从选择器中选择Facebook时,它会转到m.Facebook.com并显示“您的链接无法共享”。这里出了什么问题?

在这种情况下,我的普遍想法是嗅探android和服务器之间的通信量,并查看运行此代码时到底发送到服务器的是什么。您可以将其与有效的应用程序进行比较,这会给您一些想法。

您的意图代码看起来不错-您是否尝试过安装其他FB应用程序?

这是所有android应用程序在尝试与facebook共享时都会遇到的常见问题。Facebook阻止其他应用程序使用其应用程序进行共享。我不知道为什么,但许多公司正试图绕过这一点。目前,它是“不固定的”。抱歉。

我发现您可以使用此URL将内容共享到facebook:

http://www.facebook.com/sharer.php?s=100&p[标题]=此处为您的标题&p[摘要]=此处为您的摘要&p[url]=单击此链接时指向的url


这不需要用户安装facebook,您可以尝试:

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, the_pure_link);
startActivity(Intent.createChooser(intent, "Share with"));
如果在\u pure\u链接内有图像,或\u pure\u链接包含:

<link rel="image_src" type="image/jpeg" href="image_address" />

facebook共享将显示链接、图片和您的评论。所有这些解决方案都可以从stackoverflow.com上找到。请在此处查看:


哇,没人?甚至连评论都没有?你在使用facebook java sdk吗?不,创建一个ACTION_SEND intent并使用facebook AppI使用它与facebook面临相同的问题,可能是我们必须创建单独的按钮来向facebook共享文本。你建议如何做?是否有适用于android的wireshark类型的应用程序?如果你将你的电脑和WiFi路由器连接到dumb hub,那么你可以使用wireshark来实现,这样你就可以在你的电脑上嗅探android的数据包。那么,为什么该应用程序注册后能够接收发送意图的动作呢?这让我很困惑。似乎他们应该删除此功能。我希望Facebook能听取Android开发者的意见,允许他们从其他应用程序中使用共享功能。但我还是不知道为什么他们一开始就有。你可以查看Facebook SDK,看看是否可以使用它。基本上,你唯一的途径就是使用Facebook SDK。Facebook的Eric Tseng今天在Twitter上向我证实,他们正在寻求解决这个问题。希望下一个版本的应用程序能够正确地接受共享文本。好吧,代码可以与其他应用程序(如twitter)配合使用,但与官方的fb应用程序(我认为这是大多数人都有的应用程序)配合不好。。。