I use the following code to share content
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, "The status update text");
startActivity(Intent.createChooser(intent, "Dialog title text"));
It is OK for email, sms and whatever except Facebook.
I google the reason and it seems that it is a bug of facebook since April but unfortunately no one fixes it.
However, I find that many app can still use intent chooser to invoke Facebook successfully such as Google reader. How can they do it?
As I know, we can use Facebook API, but how they can know user choose facebook in the chooser and invoke the facebook API?
According to the latest updating to the bug tracker this is 'By Design' and the bug has been closed.
https://developers.facebook.com/bugs/332619626816423/
So looks like this isn't going to be possible via intents..
You could only send pure URL to facebook. It should be a bug on facebook App.
For more detailed information, refer to the following post
Share Text on Facebook from Android App via ACTION_SEND
Someone has posted this issue to official facebook bug tracker, but it's still not solved yet.
Bug 16728 - Android ACTION_SEND is not handled correctly
Related
New to android here but not to stackoverflow, i know this was asked before but hear me out first:
So regular Share through chooser:
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, message);
sendIntent.setType("text/plain");
No longer works!, facebook doesn't allow pre-filled text to be sent(so i understood).
BUT I've seen apps do it anyways, by first presenting a pre-filled dialog they created with the text and then showing a custom chooser for sharing.
I have no idea how they do that, i can't find any answers in the forums for pre-filled text share to facebook.
Worst part is, i want to share text with an image, like in this photo here.
Where can i get a good sample project / Tutorial for:
1. simple facebook share.
twitter and google+ sharing.
custom chooser.
Also, would like to hear your comments and regards on best practices with social media sharing AND using a chooser.
Cause i also want the be able to share to apps like WhatsApp and other of that sorts.
With facebook's new SDK you can no longer use ACTION_SEND to share text information.
You can post on behalf of the user but not pre-fill the text for a status update, at least i did not find a way to do that.
You must also have your app actions checked and accepted by facebooks policy.
The answer: Stop working with facebook untill they remove their app from the ACTION_SEND in the android chooser.
I am facing problems in implementing facebook sdk 3.0 to my android app.I have read tons of tutorials and samples .But cannot work it out.
I have also read documentation on facebook developers.
But how should i log out of facebook account and how to send a post to the facebook account which is login.
I have setup the facebook sdk to my android app perfectly. I am facing problem with further code and steps.Can anyone share the code with me regarding login, logout, sending a post to facebook account.
I am stuck to this step for very very long time..
Any help will be appreciated.Thanks in advance.
I'm not sure if you had read and follow this tutorial but it is basically what you need for SDK3.0. It is well structured and easy to follow tutorial.
https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/. Just a personal note, just don't skip any step and pay attention to Step 4. Run the Samples, where you need to create Key hash. Hope that helps.
with thise line you can share with other apps installed on the device
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT,"body text");
those links may help you with the share.
Share Text on Facebook from Android App via ACTION_SEND
http://mobile.tutsplus.com/tutorials/android/android-sdk-implement-a-share-intent/
how can I allow users to share the data(text data) they have saved in android app on their facebook wall through a share button within the app. I am not sure if I should use facebook android sdk device or share-intent. I will be thankful if someone could provide me with some information on this or tell me about any tutorials related to this.
Thanks
You can not share the text on facebook wall using intent in android. For to achieve this you need to use facebook sdk. Using intent you can share the text on email, twitter and can share the photo on facebook.
I used intent earlier to send text on facebook its was not working earlier.
As per the Facebook's Platform Policies, We cannot pre-fill the share dialog using Intent.EXTRA_TEXT. It is usually thought to be a bug, but as per a Bug Report filed here and also, here, Facebook clearly mentions that this is not the case (it's not a bug).
I found that we cannot add a caption to a photo we are uploading using Intents. The only way we can do it, is integrating the Facebook SDK in your App then photo with text caption will be shared on facebook wall.
To get started for facebbok sdk in android:
https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/
Need to share our application in all social site like Facebook,Twitter,google+ ..Using Share auth api we can share in Facebook and Twitter.
Share Auth API:
http://code.google.com/p/socialauth-android/wiki/GettingStarted
Not able to share in google+ ,is there any plugin available?
Now am using this sample program,not able to share using this.
https://github.com/imellon/Google-Plus-Android-Sample
Please help..
Google plus does not have a publicly available API yet although there are some options available at https://developers.google.com/+/mobile/android/
I would highly recommend not to use a unique SDK for each social network since they contain a lot of bugs, and are not very reliable.
If you just want to share simple text from your app to Facebook,Twitter,Google+ and so on... I would recommend to create a chooser to let the user pick which app from his phone he wants to user for sharing. It is simple, reliable and this is how it's usually done in android.
Sample code :
Intent shareIntent=new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT,"your text here");
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "post title");
startActivity(Intent.createChooser(shareIntent, "Share..."));
This will display to the user, all the apps that are capable of sharing a text post. If the user has facebook, twitter and google+ apps in his/her phone, then it will show all of them and the user can choose which ones to share to.
You might be looking for Google plus sdk for android.
Sign in
Sharing
Write moments to your user's Google+ history
+1 content in your app
I am looking for something peculiar however useful to any app developer. I have a snippet of code in my AppName.java file however not working yet. So far it is close to what I am attempting however I want to allow the user to share the application name and download link via all the programs that appear from the action intent to twitter, facebook, etc. So I don't believe I should use emailIntent, I believe I should use sendIntent but I am thinking my entire code below is completely incorrect to do either and maybe should start over. Suggestions appreciated.
Again, I only want to share the app name, a simply message saying "I loved AppName" and the download link.
Intent sendIntent = new Intent(android.Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "Download AppName for FREE at https://market.android.com/details?id=com.CompanyName.AppName");
emailIntent.setType("text/plain");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getResources().getString(R.string.recommendation_subject));
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, getResources().getString(R.string.recommendation_body));
startActivity(emailIntent);
Try to use socialauth-android Android library for authenticating, updating status and getting contacts with social networks
SocialAuth Android is an Android version of popular SocialAuth Java library. Now you do not need to integrate multiple SDKs if you want to integrate your application with multiple social networks. You just need to add few lines of code after integrating the SocialAuth Android library in your app.
try to integrate facebook api so you can post any text you want on your wall