将图像上传到朋友墙的过程,首先将图像上传到用户墙,然后获取图像ID和链接,
无法在朋友墙上发布图片,如果需要任何 fb 配置和 fb 权限,请建议我?
if (hasPublishPermission()) {
RequestBatch requestBatch = new RequestBatch();
for (GraphUser friend : selectedFriends) {
Bundle parameters = new Bundle();
Constants.showLog(TAG, String.valueOf(friend.getFirstName()));
parameters.putString("message", "Greetings!!");
parameters.putString("link", imagelink);
parameters.putString("picture", imagelink);
parameters.putString("target_id", friend.getId());
requestBatch.add(new Request(Session.getActiveSession(), friend.getId() + "/feed", parameters,
HttpMethod.POST));
Constants.showToast(this, "Posted picture on your friends wall");
}
requestBatch.addCallback(new Callback() {
@Override
public void onBatchCompleted(RequestBatch batch) {
Constants.showLog(TAG, "Posted to :" + batch.size());
}
});
Request.executeBatchAsync(requestBatch);
}