Monday, 26 August 2013

Facebook photo sharing (& October 2013 breaking changes)

Facebook photo sharing (& October 2013 breaking changes)

I'm building on a website for a client and the core functionality of it is
to share photos with other users over Facebook. So, what I've done is =>
user picks a photo he likes and clicks the "share" button
script triggers Facebook "Friend Picker" popup
user picks a friend he wants to share the photo with and clicks "OK"
script triggers ajax request to the server which uploads the specific
photo on the timeline of chosen friend
Here's the php photo sharing code =>
$facebook = new Facebook($config);
$facebook->getAccessToken();
$user_id = $facebook->getUser();
$body = array(
'source' => '@' . CURR_DIR . $photo->path,
'message' => ''
);
if ($user_id) {
try {
$result = $facebook->api('/' . $fbid . '/photos', 'post',
$body);
} catch (FacebookApiException $e) {
echo $e->getMessage();
}
}
So far this works beautifully, so my question is =>
After the Facebook's "October 2013 breaking changes", they will be
"removing the ability to post to friends' timelines via API". They advise
usage of feed dialog's from that point on. So - how to upload a photo on a
specific user's timeline using feed dialog's? Is this even possible
(because looking at the feed documentation page, I don't think it is...)?
Thanks

No comments:

Post a Comment