Skip to content

Instantly share code, notes, and snippets.

@wytanj
Forked from tracend/fb-user-liked-page.js
Created April 2, 2018 09:16
Show Gist options
  • Select an option

  • Save wytanj/a56cc3cf5b1a089a996bc8e08fb40891 to your computer and use it in GitHub Desktop.

Select an option

Save wytanj/a56cc3cf5b1a089a996bc8e08fb40891 to your computer and use it in GitHub Desktop.
Facebook JS-SDK: Check if the user has liked a page
FB.api({ method: 'pages.isFan', page_id: '{PAGE_ID}' }, function(response) {
if (response) {
alert("user has liked the page");
} else {
alert("user has not liked the page");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment