Reputation:
I will try to be as concise as possible.
Objective: Get a list of names of everyone who liked my Facebook page. This will be done in an application installed on that page. The app will then be used to create a lottery and chose a winner.
What I have so far is: appId, appSecret and an Acces-Token with me as an admin of that page. I have also found online that a query like this one would in fact do what I need:
*SELECT user_id from like where object_id = \'PAGE_ID\';'*
My question is : How do I run the query in order to make it work?
So far I have tried but all I get is an empty array...
$result2 = $facebook->api(array(
'method' => 'fql.query',
'access_token' => 'TOKEN',
'query' => 'SELECT user_id from like where object_id = \'APP_ID\';'
));
;
Any help is appreciated, Thank you.
Upvotes: 4
Views: 3268
Reputation: 43816
This is not possible - you can only check if a specific user likes the page, or retrieve a list of the pages a users likes (with appropriate permission), you can't retrieve a complete list of the users that like a specific page
{edit} As 'Query Master' said in a now-deleted answer, if your app is installed on a page tab, you can find out (via the signed_request
sent to the app - details here ) if the current user likes the page, but you still can't get their user ID unless they authorise your app{/edit}
Upvotes: 7