开发者

Unable To Share Content on Facebook through Android Application

开发者 https://www.devze.com 2023-01-29 09:14 出处:网络
I am trying to post some content to Facebook wall through my Android application. I am using the following Intent code for sharing

I am trying to post some content to Facebook wall through my Android application. I am using the following Intent code for sharing

Intent msg = new Intent(Intent.ACTION_SEND);
msg.setType("text/plain");
msg.putExtra(Intent.EXTRA_TEXT, display_quote.getText().toString() );
startActivity(Intent.createChoo开发者_运维百科ser(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" .

Is there any other way of posting to Facebook wall through Android application?


Is there any other way of posting to Facebook wall through Android application ?

Yes, and it's the way you must do it: use the Facebook SDK for android:

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. 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"); requires a URL(link). It is the cause of the message, which you have seen on the target Facebook page.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号