如何在 Facebook 上分享带有来自 android 的标题的图片?

How to share image on Facebook with Caption from android?

我尝试在 Facebook API 的帮助下在 Facebook 上分享一张带字幕的图片,代码如下:

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

            shareDialog.show(content);

它打开了 ShareDialog 但标题不会出现在对话框中

您可以使用给定的方法添加标题。但是在 facebook 的共享对话框中。您必须手动输入标题。

根据 facebook 文档共享 CBroe:

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

根据其政策 2.3,它指出

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.

因此,我们不再允许 pre-fill 使用 shareDialog 或任何其他方法为图像添加字幕。