0

the facebook share button doesn't work anymore on my website. If I click on it, the facebook popup shows this error: enter image description here

I've read this question, but the problem is that I don't have any Facebook App. Also, in the source code there isn't any reference to any AppID

My website is: this

Thanks for any help

Community
  • 1
  • 1
fas
  • 103
  • 2
  • 3
  • 13
  • When you want to share anything on Facebook, you must need to create application for that. – Milap Feb 03 '16 at 10:38
  • @Milap The sharing was working, and I didn't create any application. Just for trying, I've created an application and configured the opengraph but it didn't work either – fas Feb 03 '16 at 10:56

1 Answers1

0

First you need to create the app , after creating you need to write the following code in the page you need to share

<body>
    <script>
      window.fbAsyncInit = function() {
    //SDK loaded, initialize it
    FB.init({
        appId      : 'your-appid',
        xfbml      : true,
        version    : 'v2.5'
    });
};

//load the JavaScript SDK
(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";
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
    </script>

    <!-- Your code here -->
</body>

Note: It is better if you place facebook connect code inside the <body> tag as i did

 <p>
<a  rel="nofollow" target="_blank" class=" facebook ">Share</a>
</p>
jQuery(document).ready(function($) {
 jQuery('.facebook').click(
function(){
    FB.ui(
      {
    method: 'share',
    name: 'Facebook Dialogs',
  link: 'https://developers.facebook.com/docs/dialogs/',
  picture: 'http://fbrell.com/f8.jpg',
  caption: 'Reference Documentation',
  description: 'Dialogs provide a simple, consistent interface for applications to interface with users.'

},//For checking the response you can use 
function(response) {
  if (response && response.post_id) {
    alert('Post was published.');
  } else {
    alert('Post was not published.');
  }
}
)

});

}

);

then you need to make this app live ,for this go to your developer account on facebook (https://developers.facebook.com/) .select your app -> go to App Review -> then make yes in

Do you want to make this app and all its live features available to the general public?.

Note : Don't forgot to give email in settings->contact email

Manik
  • 513
  • 1
  • 7
  • 23