简体   繁体   English

android facebook sdk share-dialog setCaption无效

[英]android facebook sdk share-dialog setCaption is not working

I am using facebook sdk dependency 'com.facebook.android:facebook-android-sdk:4.6.0' 我正在使用facebook sdk依赖'com.facebook.android:facebook-android-sdk:4.6.0'

I want to share a photo with some text. 我想与一些文字分享一张照片。 Here is the code i used from reference 这是我从参考中使用的代码

    SharePhoto photo = new SharePhoto.Builder()
            .setBitmap(image)
            .setCaption("my caption appears here")
            .build();
    SharePhotoContent photoContent = new SharePhotoContent.Builder()
            .addPhoto(photo)
            .build();
    shareButton.setShareContent(photoContent);

It doesn't show caption in share dialog and also not in post on facebook timeline. 它不会在共享对话框中显示标题,也不会在Facebook时间轴上显示。 How to post image with text on facebook wall ? 如何在Facebook墙上发布文字图片?

Wizkid is right. Wizkid是对的。 I was trying to do something similar and noticed that the setCaption() method did not work. 我试图做类似的事情,并注意到setCaption()方法不起作用。 Take a look at the android facebook sdk documentation in this link, and read the getCaption() method description: 看看这个链接中的android facebook sdk文档,并阅读getCaption()方法描述:

" https://developers.facebook.com/docs/reference/android/current/class/SharePhoto/ " https://developers.facebook.com/docs/reference/android/current/class/SharePhoto/

"Gets the user generated caption. Note that the 'caption' must come from the user, as pre-filled content is forbidden by the Platform Policies (2.3)." “获取用户生成的标题。请注意,'标题'必须来自用户,因为平台策略(2.3)禁止预先填写的内容。”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM