Search code examples
androidsharefacebook-sdk-4.0facebook-sharerhint

How to put text in "Say something about this..." facebook text box from android programatically


I am sharing image on facebook from android app. I can view the image in facebook what I Shared. But, I need to write a text in "Say something" text box from android programatically. I dont no how i can achieve this via facebook SDK. I am using facebook SDK v4.

enter image description here


Solution

  • Facebook not allow to post text either using SDK or Intent.

    from Facebook Docs

    When you implement sharing, your app should not pre-fill any content to be shared. This is inconsistent with Facebook Platform Policy, see Facebook Platform Policy, 2.3.

    1. Don't prefill captions, comments, messages, or the user message parameter of posts with content a person or business didn’t create, even if the person can edit or remove the content before sharing. You may use our Share Dialogs to prefill a single hashtag in a post, but don't prefill any content a person or business didn't create via the API.

    You can specify a single hashtag to appear with a shared photo, link, or video. This hashtag also appears in the Share dialog, and people have the the opportunity to remove it before publishing.

    The following is an example of adding a hashtag to a link share.

    ShareLinkContent content = new ShareLinkContent.Builder()
        .setContentUrl(Uri.parse("https://developers.facebook.com"))
        .setShareHashtag(new ShareHashtag.Builder()
                .setHashtag("#ConnectTheWorld")
                .build());
        .build();
    

    Note: This(Hashtag) Additional Feature only available when you are using Facebook Share Dialog.

    For more details, please refer https://developers.facebook.com/docs/sharing/android