0
無法弄清楚如何向訪問令牌添加權限以訪問好友照片。我有:Facebook圖表PHP FQL:朋友照片權限(新SDK)
//auth user
if(empty($code)) {
$dialog_url = 'https://www.facebook.com/dialog/oauth?client_id='
. $app_id . '&redirect_uri=' . urlencode($my_url)
. '&scope=friends_photos';
echo("<script>top.location.href='" . $dialog_url . "'</script>");
}
//get user access_token
$token_url = 'https://graph.facebook.com/oauth/access_token?client_id='
. $app_id . '&redirect_uri=' . urlencode($my_url)
. '&client_secret=' . $app_secret
. '&code=' . $code
. '&scope=friends_photos';
$access_token = file_get_contents($token_url);
$fql_query_url = 'https://graph.facebook.com/'
. '/fql?q=SELECT+pid,object_id+FROM+photo_tag+WHERE+subject=301179'
. '&' . $access_token;
$graph_url = "https://graph.facebook.com/me?access_token="
. $access_token;
$user = json_decode(file_get_contents($graph_url));
$fql_query_result = file_get_contents($fql_query_url);
$fql_query_obj = json_decode($fql_query_result, true);
echo '<pre>';
print_r("query results:");
print_r($fql_query_obj);
查詢返回空。
沒有參數
perms
我還是來了空見編輯。 – JoshDG 2012-01-27 18:56:02