简体   繁体   English

无法通过Android应用程序在Facebook上共享内容

[英]Unable To Share Content on Facebook through Android Application

I am trying to post some content to Facebook wall through my Android application. 我试图通过我的Android应用程序将一些内容发布到Facebook墙上。 I am using the following Intent code for sharing 我使用以下Intent代码进行共享

Intent msg = new Intent(Intent.ACTION_SEND);
msg.setType("text/plain");
msg.putExtra(Intent.EXTRA_TEXT, display_quote.getText().toString() );
startActivity(Intent.createChooser(msg, "Share Quote"));

However when i select 'Facebook' from the options which i get , i am redirected to a URL http://m.facebook.com/sharer.php and i get an error saying that "Your Link could not be shared" . 然而,当我从我得到的选项中选择“Facebook”时,我被重定向到URL http://m.facebook.com/sharer.php ,我收到一条错误消息,说“您的链接无法共享”。

Is there any other way of posting to Facebook wall through Android application? 有没有其他方式通过Android应用程序发布到Facebook墙?

Is there any other way of posting to Facebook wall through Android application ? 有没有其他方式通过Android应用程序发布到Facebook墙?

Yes, and it's the way you must do it: use the Facebook SDK for android: 是的,这是你必须这样做的方式:使用Facebook SDK for android:

https://github.com/facebook/facebook-android-sdk/ https://github.com/facebook/facebook-android-sdk/

You can download it from the link above among with some examples. 您可以通过一些示例从上面的链接下载它。

There is a not well known bugs in the Facebook intent parser. Facebook意图解析器中存在一个鲜为人知的错误。 Some of them are solved but not completely-with new bugs. 其中一些已经解决但不完全 - 有新的错误。 Thus, msg.putExtra(Intent.EXTRA_TEXT," http://Iam_a_good_boy.com/no_doubts.asp "); 因此,msg.putExtra(Intent.EXTRA_TEXT “ http://Iam_a_good_boy.com/no_doubts.asp ”); requires a URL(link). 需要一个URL(链接)。 It is the cause of the message, which you have seen on the target Facebook page. 这是您在目标Facebook页面上看到的消息的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM