将照片上传到为我的应用创建的相册后,我想使用其id作为object_id的值来创建包含该照片的帖子。照片上传,帖子被创建,但帖子中没有照片的迹象。我拥有publish_steam和read_stream的权限。这是我正在使用的代码:
var params = {};
params['url'] = "http://some.url/image.jpg";
params['message'] = "some message entered by user";
FB.api('/me/photos', 'post', params, function(response){
if(!response){
console.log('no response after photos post');
}
else if(response.error){
console.log('response error');
}
else{
var photo_id = response.id;
console.log('response ok after post');
FB.api('/me/feed/','post',
{
name: 'App-Name',
link: 'http://url_to_my_app_on_facebook'
caption: 'caption_for_my_app',
description: 'description_for_my_app'
message: 'some message entered by user',
object_id: parseInt(photo_id),
},
function(response) {
if (!response) {
console.log('no response after feed post');
} else {
console.log('post was created');
}
}
);
}
});
这应该有用,对吗?也许你们可以在我出错的地方给我抬头......
答案 0 :(得分:-1)
Kaffeedraft
如果您的应用尚未拥有user_photos权限,则还需要使用用户访问令牌。