Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

facebook: Your link could not be shared

I'm adding the ability to share scores from my app using android's share intent:

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"));

When I choose Facebook from the chooser, it goes to m.facebook.com and says "Your link could not be shared". What's going wrong here?

like image 616
fredley Avatar asked Sep 29 '10 18:09

fredley


3 Answers

This is a common problem found in all android apps when trying to share to facebook. Facebook blocks other applications from sharing using their app. I'm not sure why, but many companies are trying to bypass this. Currently, it is "unfix-able". Sorry.

like image 166
Jack Love Avatar answered Sep 22 '22 10:09

Jack Love


Dude, you can try this:

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"));

If there is images inside the_pure_link, or the_pure_link contains:

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

The facebook share will show the link, with the image, and your comment together. All these solutions are find from stackoverflow.com. Check it here:

Share Text on Facebook from Android App via ACTION_SEND

Image share from android to facebook

like image 43
James Avatar answered Sep 21 '22 10:09

James


I found out that you can use this URL to share something to facebook:

http://www.facebook.com/sharer.php?s=100&p[title]=YOUR_TITLE_HERE&p[summary]=YOUR_SUMMARY_HERE&p[url]=YOUR_URL_TO_POINT_TO_WHEN_THIS_IS_BEEING_CLICKED

This does not require the user to have facebook installed

like image 20
runely Avatar answered Sep 18 '22 10:09

runely