我正在使用此代码获取用户朋友的列表。如果你知道这个过程,我无法找到任何参考资料
$facebook = new Facebook($config);
$user_id = $facebook->getUser();
$iLimit=99;
if($user_id) {
// We have a user ID, so probably a logged in user.
// If not, we'll get an exception, which we handle below.
try {
$user_profile = $facebook->api('/me','GET');
echo"<h3>";
echo 'Name: ' . $user_profile['name'];
echo"</h3>";
$profile_pic = "http://graph.facebook.com/".$user_id."/picture";
echo "<img src=\"" . $profile_pic . "\" />";
$user_friends = $facebook->api('/me/friends', 'GET' );
print_r($user_friends); //Given NULL Value
echo "</pre>";\
返回空值
答案 0 :(得分:0)
请参阅facebook图表api docs https://developers.facebook.com/docs/graph-api/reference/friend-list/ 这是带教程的代码 http://www.sanwebe.com/2011/10/facebook-friends-list-pagewise-with-php 希望它有所帮助!