0

Is there a way to see if a facebook user liked a page? It might not be the logged in user, a user might not be logged in at all... The page might not be the page where the app is installed. Thanks!

Cœur
  • 37,241
  • 25
  • 195
  • 267
Piter
  • 1
  • 1
  • did you try this https://graph.facebook.com//likes – samirprogrammer May 09 '12 at 07:33
  • Yes, that returns the likes that a page have? I also tried https://graph.facebook.com/UID/likes/PAGEID?access_token=XXX - this seems to work, but only for my account. When I tried with other random accounts, the response is FALSE. Maybe I am setup as developer? :( – Piter May 09 '12 at 07:46
  • why you not using only your account to check likes? you can get all likes in json and then compare with uid wheather user exist or not – samirprogrammer May 09 '12 at 07:49
  • It's the same, I tried to get https://graph.facebook.com/MYID/likes?access_token=XXX - it works, i get all pages I liked, no matter if I'm logged in or not. But for another user, it doesn't work :( – Piter May 09 '12 at 07:54
  • This is the thing: A user, A page... they might not be related, owner... user might not be logged in... As I seen, for the graph/UID/likes/PAGEID - user has to grant the user_likes permission to the app... – Piter May 09 '12 at 08:02
  • yes, then you need user_likes permission to access his likes – samirprogrammer May 09 '12 at 08:06

2 Answers2

1

You have to make sure you have the "user_likes" scope. Then you use the graph api by doing a ('me/likes'), and put a condition on it (if name=='yourpage').

Sarah L.
  • 85
  • 1
  • 5
0

You can get user likes with permissions in application or if your application is a canvas application you can get it with this way;

Fans-only content in facebook with asp.net C# sdk

Community
  • 1
  • 1
Xenon
  • 815
  • 11
  • 26