我无法得到我所有的facebook朋友的名字,使用下面的代码我可以获得最多1036个朋友的名字,在我的脸谱中我有1091个朋友的名字。
$requestFriends = $fb->get('/me/taggable_friends?fields=name&limit=100');
$friends = $requestFriends->getGraphEdge();
// if have more friends than 100 as we defined the limit above on line no. 68
if ($fb->next($friends)) {
$allFriends = array();
$friendsArray = $friends->asArray();
$allFriends = array_merge($friendsArray, $allFriends);
while ($friends = $fb->next($friends)) {
$friendsArray = $friends->asArray();
$allFriends = array_merge($friendsArray, $allFriends);
}
foreach ($allFriends as $key) {
//echo $key['name'] . "<br>";
}
echo count($allFriends);
} else {
$allFriends = $friends->asArray();
$totalFriends = count($allFriends);
foreach ($allFriends as $key) {
//echo $key['name'] . "<br>";
}
echo count($allFriends);
}
我已将限制从100,500,100,2000更改,但最多可提供1036。任何人都知道如何获得所有朋友的名字。