I have an Android app and it supports sending text via other apps. It therefore uses the ACTION_SEND intent and the EXTRA_TEXT field. The chooser presents me with all apps that can handle such an intent. Those are Twitter, EMail, ... and Facebook. But when I select Facebook it opens the browser and goes to the following page:
http://m.facebook.com/sharer.php?u=mytext
It shows my text and the submit button. But when I press the submit button nothing happends. The page just loads again. I think maybe it is only possible to send URLs via the Facebook App. Could that be?
Did anyone manage to send text via ACTION_SEND through the Facebook Android app?
So I have a work around, but it assumes you have control over the page you're sharing...
If you format your EXTRA_TEXT like so...
... then on non-Facebook apps, your text should appear something like this:
Now if you update your website such that requests with the extraText query parameter return the contents of extraText in the page's meta data.
Then when Facebook escapes that url to generate the dialog, it'll read the title meta data and embed it into your share dialog.
I realize this is a pretty yuck solution, so take with a grain of salt...
06/2013 :
First you need query Intent to handler sharing option. Then use package name to filter Intent then we will have only one Intent that handler sharing option!
Share via Facebook
Bonus - Share via Twitter
And if you want to find how to share via another sharing application, find it there Tép Blog - Advance share via Android
if you want to show text put # at the begging of the message you want it will share it as Hashtag
To make the Share work with the facebook app, you only need to have suply at least one link:
This will show the correct sharing window but when you click on share, nothing happends (I also tried with the official Twitter App, it does not work).
The only way I found to make the Facebook app sharing work is to share only a link with no text:
It will show the following window and the Share button will work:
Apparently it automatically takes an image and text from the link to populate the share.
If you want to share only text, you will have to use the facebook api: https://github.com/facebook/facebook-android-sdk
EDITED: with the new release of the official Facebook app for Android (July 14 2011) IT WORKS!!!
OLD: The examples above do not work if the user chooses the Facebook app for sharing, but they do work if the user chooses the Seesmic app to post to Facebook. I guess Seesmic have a better implementation of the Facebook API than Facebook!