1

Possible Duplicate:
Seamless way to check if user likes page

How can I make a like to unlock content tab on Facebook?

I´ve seen some applications that let me do this, but I don't want any branding on my tab.

Community
  • 1
  • 1
Richie
  • 29
  • 1
  • 3

2 Answers2

1

You need to query page_fan, example using JavaScript SDK:

            var fqlQuery = "SELECT uid FROM page_fan WHERE page_id = " + pageId + " and uid=" + userId;
            var query = FB.Data.query(fqlQuery);
            query.wait(function (rows) {

                if (rows.length == 1 && rows[0].uid == userId) {
                    alert(true);
                } else {
                    alert(false);
                }
            });

I think that will you need to ask for this permission: user_likes

Felipe Pessoto
  • 6,855
  • 10
  • 42
  • 73
0

First you will need to find if the user is a fan or not. You can use the signed_request to do so. "You will need to register a Facebook application". Read more about signed_requests at Signed Request.

Then you can use the returned data to find if the user is a fan, administrator, etc.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Mohammed Ibrahim
  • 550
  • 1
  • 5
  • 15