wesside
wesside

Reputation: 5740

Facebook - Detect previously liked

  FB.Event.subscribe('edge.create', function(response) {         
     $.ajax({
        url: $(location).attr("href") + "?facebook=true",
        success: function()
        {
            alert("You now get the promotion.");
        }
     });  
  }); 

This will set a cookie for me, through an ajax redirect IF they clicked like.

So the question is, how can you figure out if someone has previously liked your page? I swear I've spent half the day in the API. Is this possible?

Upvotes: 1

Views: 157

Answers (1)

bkaid
bkaid

Reputation: 52083

If the user has authenticated with your Facebook application, you can all the /me/likes graph api function with a url of https://graph.facebook.com/me/likes?access_token=.... If not, you will need to keep track of likes in your own database, but this won't work for people that have liked your page directly on facebook.

Upvotes: 1

Related Questions