0

Possible Duplicate:
How to check if a user likes my Facebook Page or URL using Facebook’s API

Is there any way to check with JS if I did "like" a Facebook page?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Eliya Cohen
  • 10,716
  • 13
  • 59
  • 116

1 Answers1

0

You can use FQL to check the page_fan table

Documentation here

Query like so

SELECT created_time FROM page_fan WHERE uid='$UID' and page_id='$PAGE_ID'

if a row exists, then they are a fan.

You can call the api with the javascript SDK like so:

FB.api({
    method: 'fql.query',
    query: 'SELECT created_time FROM page_fan WHERE uid=' + uid + ' AND page_id=' +page_id,
    return_ssl_resources: 1
}, function(response){
    console.log(response);
});
Tommy Crush
  • 2,790
  • 1
  • 15
  • 18