RECONOCER SI EL USUARIO ES FAN DE TU PAGINA FACEBOOK


/ Published in: JavaScript
Save to your folder(s)

Verifica si el usuario es fans de la pagina o no.


Copy this code and paste it in your HTML
  1. <fb:login-button perms="user_likes">
  2. Grant Permissions to Allow access to Likes
  3. </fb:login-button>
  4.  
  5. <button onclick="checkDoesLike()">Check si eres fans</button>
  6.  
  7. <h1>Like this Application's Page</h1>
  8. <fb:like-box profile-id="ID_APP"></fb:like-box>
  9.  
  10. <script>
  11. window.checkDoesLike = function() {
  12. FB.api({ method: 'pages.isFan', page_id: 'ID_APP' }, function(resp) {
  13. if (resp) {
  14. alert('You like the Application.');
  15. } else {
  16. alert("You don't like the Application.");
  17. }
  18. });
  19. };
  20. </script>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.