我很难用图片创建一个facebook活动。 我已经尝试了很多在stackoverflow上找到的东西,但大多数都是使用php SDK。 Facebook文档也没有包含如何将照片发布到活动的示例。
我正在使用的代码是:
params = {'name': "some_name",
'picture':"some_img_url_at_my_server",
//or 'picture':"@some_img_url_at_my_server",
//or '@picture':"@some_img_url_at_my_server",
//or 'source':"some_img_url_at_my_server",
//or 'source':"@some_img_url_at_my_server",
//or 'picture':"some_img_path_at_my_server",
//or 'picture':"@some_img_path_at_my_server",
//or '@picture':"@some_img_path_at_my_server",
//or 'source':"some_img_path_at_my_server",
//or 'source':"@some_img_path_at_my_server",
'start_time': "some_date"
};
FB.api('/me/events', 'post', params, function (response) {
if (!response || response.error) {
log(response.error);
} else {
alert('Post ID: ' + response.id);
}
});
事件已创建,但未显示任何图片。
我在某处读到我必须将图片数据编码到我正在制作的帖子,但我不知道如何尝试这样做。
我从php页面获取数据所以,我也可以在php页面中这样做,但同样,我不知道我必须做什么。
有人可以帮忙吗?
谢谢
答案 0 :(得分:0)
看起来你必须分两步完成:
id
。POST
至/EVENT_ID/picture
,其中包含source
参数中的图片内容。有关详细信息,请参阅here。