Reputation: 33941
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?
Upvotes: 7
Views: 5467
Reputation: 21
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
Upvotes: 2
Reputation: 5159
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
Upvotes: 2
Reputation: 726
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.
Upvotes: 2
Reputation: 915
Your intent code looks fine - have you tried installing a different FB app?
Upvotes: 0
Reputation: 6585
My universal idea in such siturations is to sniff traffic between android & server and see what exactly been sent to the server when you run this code. The you can compare it to something which works, and this would give your some ideas.
Upvotes: 0