我想使用 Facebook SDK 从本地用户设备发布带有消息或描述的图像,我在此网站上查看了一些旧的解决方案,但我想使用最新的 Facebook sdk 版本 (3.5) 我可以通过此代码发布图像,但无法添加描述或消息
public void shareImageNow(Activity activity, String message,
Bitmap bitmap, UiLifecycleHelper uiHelper) {
List<Bitmap> images = new ArrayList<Bitmap>();
images.add(bitmap);
if (FacebookDialog.canPresentShareDialog(
activity.getApplicationContext(),
FacebookDialog.ShareDialogFeature.PHOTOS)) {
// Publish the post using the Photo Share Dialog
FacebookDialog shareDialog = new FacebookDialog.PhotoShareDialogBuilder(
activity).addPhotos(images).build();
uiHelper.trackPendingDialogCall(shareDialog.present());
} else {
// The user doesn't have the Facebook for Android app installed.
// You may be able to use a fallback.
}
}
谢谢
最佳答案
您不能通过共享对话框。所有消息都应由用户生成,如果您使用共享对话框,则对话框中会有一个选项供用户添加消息或说明。
关于java - 使用最新版本的 Android 版 Facebook SDK 发布带有描述的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27651101/