0

直到今天,我的 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 更改或任何替代工作方法来标记朋友。谢谢。

4

2 回答 2

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);
于 2012-09-13T02:19:19.290 回答
0

我可以确认这种行为,在 javascript SDK 上遇到了同样的问题,请参阅我的帖子了解详情: Facebook javascript photo upload+tagging API changed last night (2012 Sept.12th)? 正如 shiba_tsubasa 提到的那样,两步上传+标记仍然有效,这对于 php sdk 应该没问题(在 javascript sdk 上不太好,例如用户在第一步后立即关闭浏览器)

于 2012-09-13T04:00:04.587 回答