I'm having a hard time creating a facebook event with a picture. I've tried many things found on stackoverflow, but most of them are using the php SDK. Facebook documentation also doen't include an example on how to post a photo to the event.
The code I'm using is:
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);
}
});
The event gets created but no picture is shown.
I read somewhere that I have to url encode the picture data to the post I'm making but I don't know the way to do that in order to try it.
I fetching the data from a php page so, I could do that in the php page as well, but again, I don't know what I have to do exactly.
Can anyone please help?
Thank you