masa
masa

Reputation: 21

How can I get user id for likes of my page?

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 my 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:

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

Upvotes: 2

Views: 5437

Answers (3)

mad
mad

Reputation: 19

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);

?>

Upvotes: 1

Jean Louis
Jean Louis

Reputation: 1555

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.

Upvotes: 0

bkaid
bkaid

Reputation: 52073

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/

Upvotes: 5

Related Questions