Ad

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...)?

Ad

Answer

So - how to upload a photo on a specific user's timeline using feed dialog's? Is this even possible

No, its not possible. I think you are now left with just one option- to post the photo on the user's wall (instead of friends'), and tag him/her on the photo. To tag friends, you have to use parameter: tags. Ref: Photo

Ad
source: stackoverflow.com
Ad