脸书好友图片/布里斯日等名字都可以



我正在使用以下内容,它可以完美地显示朋友的名字

$access_token = "___access-token___";
$friendsList = json_decode(file_get_contents("https://graph.facebook.com/me/friends?access_token=".$access_token),true) ;
$data = $friendsList['data'] ;
foreach ($data as $nr => $friends)
{
 echo $friends['name'].'<br /><br />';  // line AAA     
}

但是,如果尝试将行 AAA 更改为例如 $friends["生日"] 或$friends["图片"],我什么也得不到?? 有什么想法吗?

顺便说一句,RE 生日,我已经friends_birthday

范围内允许此信息

直接在请求中定义所需字段:

https://graph.facebook.com/me/friends/?fields=birthday,picture

如果您被允许查看朋友的生日 - 它将在结果行中

朋友只包含姓名和 ID,您必须将其链接到用户表才能使用朋友 id 获取朋友的生日。

https://graph.facebook.com/me/friends将返回仅带有ID名的朋友列表。

如果您想为每个朋友
提供基本个人资料- 呼叫 https://graph.facebook.com/friend_user_id

获取扩展配置文件
呼叫 https://graph.facebook.com/friend_user_id?access_token=append_valid_access_token

如果您想要更广泛的个人资料详细信息,则需要具有必要的权限看;https://developers.facebook.com/docs/authentication/permissions/

为了能够获取扩展的个人资料信息,您

最新更新