Search code examples
androidfacebookfacebook-share

How to share image on Facebook with Caption from android?


I tried sharing an Image with Caption on Facebook with the help of Facebook API and the code as below:

SharePhoto photo = new SharePhoto.Builder()
                    .setBitmap(image)
                    .setCaption("Caption is Important")
                    .build();
            SharePhotoContent content = new SharePhotoContent.Builder()
                    .addPhoto(photo)
                    .build();

            shareDialog.show(content);

It open up the ShareDialog but the caption wont appear in it the dialog


Solution

  • As per the facebook documentation shared CBroe:

    https://developers.facebook.com/policy#control

    According to its policy 2.3 it states that

    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.

    So we are no longer allowed to pre-fill captions for images by using shareDialog or by using any other method.