Using PHP-SDK to get the album details
I'm tried get the details of an album using the PHP-SDK and facebook class, using the following code:
$data = $facebook->api('me/albums');
the code above return an empty array.
But if I try get the friends:
$friends = $facebook->api('/me/friends');
works fine. Why? the permissions are same.
开发者_运维知识库in 'pure' mode:
$url = "https://graph.facebook.com/me/albums/?access_token={$_SESSION['access_token']}";
$res = curl($url);
$json = json_decode($res);
too works fine.
to get the alubms details of the currently logged-in user, you need to request for the "user_photos" permission too.
You have to have "user_photos" permission to access this resource. Make sure the access_token you are using takes care of that.
精彩评论