I tried:
$args = array(
\'access_token\' => $access_token,
\'id\' => $uid
);
$url = \"https://graph.facebook.com/{$idPhoto}/tags\";
$ch = curl_in
There is no current mechanism to set tags with the Facebook Graph API.
You can use photos.addTag with the old REST API which you should be able to download here: http://pearhub.org/get/facebook-0.1.0.tgz. If anyone has a better link, I would appreciate it.
Looking at this article from the Facebook developers http://developers.facebook.com/blog/post/371 it seems likely that the new API will never support setting tags "let the users do the tagging". This is unfortunate for apps (like mine) that want to integrate tagging.
Change the url to
$url = "https://graph.facebook.com/{$idPhoto}/photos";
tags
is not a compatible method! use photo
to retrieve the specified data
Take a look at!
http://developers.facebook.com/docs/reference/api/photo for tagging users in photos.
Uploading image and tagging multiple people in one step using PHP Facebook Graph API:
$args = array(
'message' => 'Message',
'image' => '@' . realpath($path_to_image),
'tags' => array(
array(
'tag_uid'=> $friend1_uid,
'x' => $x1,
'y' => $y1,
),
array(
'tag_uid' => $friend2_uid,
'x' => $x2,
'y' => $y2,
),/*...*/
),
);
$data = $facebook->api('/me/photos', 'post', $args);
Where $facebook is initialized Facebook PHP SDK object. $data['id'] is id of uploaded photo.
Notes: 1. fileUpload option has to be set when initializing Facebook object:
$facebook = new Facebook(array(
/*..*/
'fileUpload' => true,
));