我徒劳地试图找到正确的答案。 我试过了:
try{
//$fql = "SELECT name,political,activities,interests,movies FROM user WHERE uid = me() OR uid IN (SELECT uid2 FROM friend WHERE uid1 = me())";
$fql = "SELECT name,political,activities,interests,movies,books,quotes,about_me FROM user WHERE uid = ".$abc;
$param = array(
'method' => 'fql.query',
'query' => $fql,
'callback' => ''
);
$friendProfileInfo = $facebook->api($param);
}
catch(Exception $o){
d($o);
}
我也试过这个:
$friendProfileInfo = $facebook->api('/me/friends?fields=id,name,political,activities');
我已经宣布了所需的权限:
$loginUrl = $facebook->getLoginUrl(
array(
'scope' => 'user_groups,user_about_me,user_religion_politics,user_interests,friends_groups,friends_interests,friends_religion_politics,friends_about_me',
'redirect_uri' => $fbconfig['baseurl']
)
);
但我只获取id,name作为返回值。请帮忙。
答案 0 :(得分:0)
fql?q=SELECT political,activities FROM user WHERE uid in (SELECT uid2 FROM friend WHERE uid1 = me())
这里有一些结果:
{
"political": "Aleister Crowley 2012 (Other people are not your property)",
"activities": "Invisible Pink Unicorn, Amatuer radio, Sound Engineering, Ice hockey, Child, Shooting"
},
{
"political": null,
"activities": "Sailing, Hiking, Mountain biking, Camping, Kayaking, Snorkeling, Walking on the Beach With Andrea"
},
{
"political": "Moderate conservative",
"activities": "McRib, Road trips, And Poking Dead Things With a Stick, Long Walks on the Beach"
},
请务必使用linter检查您的访问令牌,以确保您拥有正确的权限:friends_activities
和friends_religion_politics
这是我通过linter运行时访问令牌的结果(错误的复制粘贴,但你明白了):
发布时间:1324594818:2011年12月22日下午3:00 过期:从不 有效:正确 来源:网络 范围:ads_management create_event create_note email export_stream friends_about_me friends_activities friends_birthday friends_checkins friends_education_history friends_events friends_games_activity friends_groups friends_hometown friends_interests friends_likes friends_location friends_location_posts friends_notes friends_online_presence friends_photo_video_tags friends_photos friends_questions friends_relationship_details friends_relationships friends_religion_politics friends_status friends_subscriptions friends_videos friends_website friends_work_history manage_friendlists manage_notifications manage_pages offline_access photo_upload publish_checkins publish_stream read_friendlists read_insights read_mailbox read_requests read_stream rsvp_event share_item短信 status_update user_about_me user_activities user_birthday user_checkins user_education_history user_events user_games_activity user_groups user_hometown user_interests user_likes user_location user_location_posts user_notes user_online_presence user_photo_video_tags user_photos user_questions user_relationship_details user_relationships user_religion_politics user_status user_subscriptions user_videos user_website user_work_history video_upload xmpp_login