我的Facebook照片代码应用程序运行良好,直到今天。我使用以下代码标记照片中的朋友。
$attachment = array(
'message' => $mes,
'tags' =>
array(
array(
'tag_uid'=> $re[0],
'x' => '30',
'y' => '60',
),
array(
'tag_uid'=> $re[1],
'x' => '30',
'y' => '50',
),
array(
'tag_uid'=> $re[2],
'x' => '30',
'y' => '70',
),
array(
'tag_uid'=> $re[3],
'x' => '30',
'y' => '10',
),
array(
'tag_uid'=> $re[4],
'x' => '10',
'y' => '60',
),
array(
'tag_uid'=> $re[5],
'x' => '40',
'y' => '60',
),
array(
'tag_uid'=> $re[6],
'x' => '50',
'y' => '60',
),
array(
'tag_uid'=> $re[7],
'x' => '60',
'y' => '60',
),
array(
'tag_uid' => $re[8],
'x' => '80',
'y' => '60',
)
)
);
$facebook->setFileUploadSupport(true);
$attachment['image'] ='@'.realpath($filename);
$photo = $facebook->api('/'.$aid.'/photos', 'POST', $attachment);
但是此代码不再标记朋友。它只是上传照片。 Facebook中是否有任何API更改或任何标记朋友的替代工作方法。谢谢。
答案 0 :(得分:1)
分隔帖子和标记,API将正常工作
$attachment = array(
'message' => $mes,
);
$facebook->setFileUploadSupport(true);
$attachment['image'] ='@'.realpath($filename);
$photo = $facebook->api('/'.$aid.'/photos', 'POST', $attachment);
//tagging
$tags = array(
'tag_uid'=> $re[0],
'x' => '30',
'y' => '60',
);
$response = $facebook->api('/'.$photo['id'].'/tags', 'POST', $tags);
答案 1 :(得分:0)
我可以确认这种行为,在javascript SDK上遇到同样的问题,详见我的帖子: Facebook javascript photo upload+tagging API changed last night (2012 Sept.12th)? 正如shiba_tsubasa提到的两步上传+标记仍然有效,这对于php sdk应该没问题(在javascript sdk上不是很好,例如用户在第一步后立即关闭浏览器)