The Facebook Likes button is not displayed when not logged into Facebook.

We use the Facebook JavaScript API version 2.0 (for example, sdk.js) to display the Facebook Likes button on our website. We used to have an 18+ age restriction on our website's Facebook page, which we removed a week before. But still we don't get the Facebook Likes button when the user is not logged into Facebook. If a user has registered with Facebook and accessed our page, the "like" button is displayed correctly.

Below are examples of JavaScript and HTML used on our website to display the Facebook Likes button.

The JavaScript code looks like this:

<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/en_US/sdk.js#xfbml=1&appId=xxx&version=v2.0";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

      

HTML looks like this:

<div class="fb-like" data-href="https://developers.facebook.com/docs/plugins/" data-layout="box_count" data-action="like" data-show-faces="true" data-share="false"></div>

      

You can find the same from https://developers.facebook.com/docs/plugins/like-button

Our site contains adult content. Does Facebook validate content before showing the Likes button ? If so, is there any solution for displaying the Likes button ?

Any help is appreciated.

+3


source to share


1 answer


Adding Facebook like buttons seems OK here. You will not be logged out of the user's Facebook account. As well as checking the active user session in the browser.



0


source







All Articles