1

There are two sets of javascript SDK code, the one given on the SDK page:

<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId      : 'myappidnumbers', // App ID
      channelUrl : '//www.mywebsite.com/channel.html', // Channel File
      status     : true, // check login status
      cookie     : true, // enable cookies to allow the server to access the session
      xfbml      : true  // parse XFBML
    });

    // Additional initialization code here
  };

  // Load the SDK Asynchronously
  (function(d){
     var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement('script'); js.id = id; js.async = true;
     js.src = "//connect.facebook.net/en_US/all.js";
     ref.parentNode.insertBefore(js, ref);
   }(document));
</script>

and the one generated when getting the code for the button:

<div id="fb-root"></div>
<script>
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/es_ES/all.js#xfbml=1&appId=myappidnumbers";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>

No matter which I use, the Like button is not showing up. I have tried to use the debugger, and gotten this warning for the Like button:

Admins And App ID Missing: fb:admins and fb:app_id tags are missing. These tags are necessary for Facebook to render a News Feed story that generates a high click-through rate.

This may be a simple question for you experienced folks, but I have no idea what to do to make the like button show up. What am I missing?

2
  • In the top block of code you should put your numeric app id, not the namespace. In the top block, you have extra initialization code, but the boiler plate at the bottom (though slightly different) is functionally exactly the same. Sep 25, 2012 at 5:16
  • Downvote because of FB Disconnect Sep 26, 2012 at 7:11

2 Answers 2

1

Try to set

<meta property="fb:app_id" content="YOUR APP ID" />
<meta property="fb:admins" content="YPUR USER ID" /> 

in your HEADER, after test your web site with https://developers.facebook.com/tools/debug the url linter :)

1
  • That removed the warnings. Thanks! Sep 25, 2012 at 19:16
0

The second, shorter set of SDK code is all that is needed.

Initially, I was testing with Chrome and nothing was showing up. I realized after testing it successfully on other browsers what the problem was: I had FB Disconnect (chrome extension) enabled. Whoops.

Not the answer you're looking for? Browse other questions tagged or ask your own question.