我尝试使用 Facebook API 中的标记功能,但它不起作用。
这是权限代码:
$facebook->getLoginUrl(
array(
'canvas' => 1,
'fbconnect' => 0,
'req_perms' => 'user_photos, friends_photos, publish_stream,
offline_access, user_likes, user_photo_video_tags',
'next' => $appCanvasPage.'index.php',
'cancel_url' => $appCanvasPage
)
);
这是我尝试的第一种方法:
$photoId = $userid."_".$upload_photo['id'];
$post_url = "https://graph.facebook.com/"
.$$photoId . "/tags/" . $friendid
. "?access_token=". $access_token
. "&x=" . $x_coordinate
. "&y=" . $y_coordinate
. "&method=POST";
file_get_contents($post_url);
这将返回一个错误:
"message": "Unsupported post request.",
"type": "GraphMethodException",
"code": 100
我试过的第二种方法:
$fd = 'XXXX';
$tag = array(
'tag_uid' => $fd,
'x' => '10.0',
'y' => '10.0'
);
$tags = array($tag0);
$facebook->api(
array(
'method' => 'photos.addTag',
'pid' => $photoId,
'tags' => json_encode($tags)
)
);
此代码也不标记照片。