我尝试在Facebook API中使用标记功能,但它不起作用。无法用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)
)
);
此代码也不标记照片。
我曾尝试it..it犯规work..anything我需要改变。 。 – user1536721 2012-07-19 06:14:09
嗯没有?你得到什么样的错误? – mask8 2012-07-19 06:18:53
没有错误出现..但图片没有标记和代码停止那里..没有页脚后代码... – user1536721 2012-07-19 06:20:40