0
我想從使用Facebook SDK的消息或說明的本地用戶設備發佈圖片,我在這裏查看了一些舊的解決方案,但是我想用最後一個Facebook的SDK版本(3.5) 我可以通過這個代碼後的圖像,但我無法添加描述或消息使用最新版本的Facebook SDK for Android發佈圖片及描述
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.
}
}
感謝