Search code examples
androidfacebookandroid-intenttwitterandroid-sharing

Share to Facebook in android (like twitter)


As anyone who's tried to share to Facebook via Android knows, the Facebook team has decided to disregard the protocol for sharing and ignores the text provided in the share intent (see: Share Text on Facebook from Android App via ACTION_SEND)

However, it appears that the twitter app has figured out how to circumvent this. When you're looking at a tweet:

Twitter view

You can click the share icon below the tweet and it brings up the normal share dialog with a list of apps, including Facebook:

All the share icons, including Facebook that decided to screw over Android developers

If you click on Facebook, you get this view:

Damn you facebook. Damn you.

Which looks perfect, and clearly twitter is sending more than just a link that other answers seem to propose. Furthermore, if you share to messaging:

Good old messaging app. F___ facebook

You can see that the text is properly added and there are no issues. How did twitter get this to work?


Solution

  • Just to close out this question, I believe the way it works for Twitter in the example is based on the meta data available in the url provided. This is a good starting point: https://developers.facebook.com/docs/sharing/best-practices#tags