0

i have a big problem for sharing text via ShareDialog. It seems i can only share predefined links,descriptions... but not text. Is there any other way to share text of Facebook from my Android app. My code is:

FacebookDialog shareDialog = createShareDialogBuilderForLink().build();

 private FacebookDialog.ShareDialogBuilder createShareDialogBuilderForLink() {
    return new FacebookDialog.ShareDialogBuilder(this)

            .setCaption("Here Comes the Boom!!!!")
            .setName("Hello Facebook")
            .setDescription("Here is my description")
            .setLink("http://developers.facebook.com/android");
}

2 Answers 2

2

It's impossible, you have to use the Facebook api to do this.

More informations here: https://stackoverflow.com/a/22123047/2065418

8
  • Hmm thank you, but it must be some other way to do this. Apr 8, 2014 at 8:52
  • Not without the facebook api !
    – Damien R.
    Apr 8, 2014 at 8:53
  • Ok, i understand i see a backdoor maybe i can put the text on description. Apr 8, 2014 at 8:58
  • If it is impossible then why does the builder even have methods setName(...) setDescription(..) .. etc? This doesnt make sense
    – Greg Ennis
    Jul 26, 2014 at 18:22
  • Well i guess it was possible a long time ago, and then they restricted the possibilities. It's very annoying, but their is not other solutions than use their API !
    – Damien R.
    Jul 28, 2014 at 7:10
1

Code for Facebook sharing text/link

public void post(String post_text) {

    Bundle postParam = new Bundle();

    Request.Callback callback = new Request.Callback() {
        @Override
        public void onCompleted(Response response) {

            // shareDialog.dismiss();
            // showPublishResult("Photo Post", response.getGraphObject(),
            // response.getError());
        }
    };
    Session session = createSession();
    postParam.putString("name", post_text);

    postParam.putString("link", "https://developers.facebook.com/android");

    Request request = new Request(session, "me/feed", postParam,
            HttpMethod.POST, callback);

    RequestAsyncTask task = new RequestAsyncTask(request);
    task.execute();

}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.