2

I want to check if a user likes a page without them having to do facebook connect on an external site. Is this possible?

I could get a list of likes from a user using this method but they have to "allow" the app access:

https://graph.facebook.com/me/likes?access_token=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

But that seems a bit of a pain. I've looked around on stack overflow but can't find a solution! I also saw this solution:

https://graph.facebook.com/me/likes?access_token=AAAAAITEghMBALZCsBzd2TwFy79jtDnZAt0ji6fZCFjlNBVNfmkBsTzWtL7MMNAiyCrfj7jIqrEqN6f0yPVOkhfVv2EBoX6IVh2hTv8LgZDZD

But that still requires users to "allow" access?

Cheers, Al

Alex Fox
  • 1,175
  • 2
  • 15
  • 27

3 Answers3

1

You can't retrieve information about a user (not even the user_id) without the user explicitly allowing you (your app). Also for the "Likes", you will still need the user_likes permission too!

ifaour
  • 38,035
  • 12
  • 72
  • 79
  • ifaour, i believe he is asking for a page, not an app. You already answered this one I think before: http://stackoverflow.com/questions/5329818/seamless-way-to-check-if-user-likes-page – Maurice Kroon Oct 22 '11 at 17:10
1

I believe that for a page you can decode the signed_request, a parameter that facebook sends. I'm actually working on it now, in ruby.

Check for the 'page' attribute. More info: http://developers.facebook.com/docs/authentication/signed_request/

Maurice Kroon
  • 959
  • 4
  • 13
  • 29
1

If the app is installed on a page tab, Maurice's answer is the best solution.

If it's another type of app, once you have the user authorised, you can make a call to /{user id}/likes/{page id} to check if the user likes your page - see 'Belongs' on https://developers.facebook.com/docs/reference/api/user/

Igy
  • 43,710
  • 8
  • 89
  • 115