I'm developing for a Facebook page with Graph API, and would like to know how to get the user IDs of users who like m开发者_开发技巧y Page, even though I can get picture and name of those fans using the social plugin.
I've tried the following methods with no luck:
Two graph methods:
graph.facebook.com/page_id/members/
doesn't workgraph.facebook.com/page_id/members/user_id
works, but one by one
Two FQL queries:
SELECT uid FROM page_fan WHERE page_id="124618122608487" and uid=me()
-- works, but one by one
SELECT uid FROM page_fan WHERE page_id="124618122608487"
-- doesn't work
Facebook won't tell you who likes your page, just an aggregate total number.
Note: for privacy reasons it is not possible to query for all users who like a Page.
http://developers.facebook.com/docs/reference/fql/like/
You do not need to log in to the page you may like to know about the signed request: here is my example code:
<?php
list($a, $b) = explode('.', $_REQUEST["signed_request"], 2);
$data = json_decode(base64_decode(strtr($b, '-_', '+/')), true);
print_r($data);
?>
It's not possible by default. But you can use Facebook Connect to get a user to be logged and then you can get info about him.
精彩评论