如何使用图形API上传带有标记信息的照片?
我找到的php解决方案是http://forum.developers.facebook.net/viewtopic.php?id=86152
$data = array(
'tag_uid' => $friend,
'x' => rand() % 100,
'y' => rand() % 100
);
$datatags[] = $data;
$attachment = array(
'access_token' => $access_token,
'tags' => $datatags
);
$facebook->setFileUploadSupport(true);
$attachment['image'] ='@'.realpath($filename);
$photo = $facebook->api('/'.$aid.'/photos', 'POST', $attachment);
只需要知道添加多个标签的语法。
感谢。
答案 0 :(得分:1)
您可以通过传递标记数组数组来设置多个标记,如下例所示:Uploading image and tagging multiple people in one step using PHP Facebook Graph API