System.out.println("picture of publisher : "+facebook.getPictureURL(feed.get(41).getFrom().getId()));
我是不熟悉Facebook开发的人,在Flash游戏中测试了adobe api之后,我决定使用与我的Flash游戏进行通信的图形api进行测试。在完成了诸如连接并获取用户数据的基本操作之后,我想知道是否有可能获取用户的朋友的个人资料,因此我可以将其传递给Flash游戏中的UILoaders并显示给他们。
[如果有人可以向我指出使用facebook graph api的基本操作的示例,例如邀请朋友或在墙上张贴,那将是非常棒的。
谢谢。
更新:
使用Nathan的建议,我试图结识我的朋友,并且有效:
$friends= $facebook->api('/me/friends?token='.$session['access_token']);
var_dump($friends);
然后我试图用以下方式获取朋友的照片:
foreach ($friends['data'] as $friend)
{
$picture= $facebook->api('/'.$friend['id'].'/photo');
}
但是它没有用。有什么主意吗?
谢谢。
尚未在此处发布最简便的方法:
/'.$album['id'].'/photos
我正在使用http://facebook4j.org/en/code-examples.html,这太简单了。
System.out.println("picture of publisher : "+facebook.getPictureURL(feed.get(41).getFrom().getId()));
我一直在寻找相同的功能,只是注意到不再可能了(在撰写本文时:2019-11-17,api v5.0)。
/me/friends?fields=friends{name,id,profile_pic}
,您会收到一个空的朋友数组:{
"data": [
],
"summary": {
"total_count": 823
}
}
图形浏览器显示此调试消息:Only friends who installed this app are returned in API v2.0 and higher. total_count in summary represents the total number of friends, including those who haven't installed the app.