I am developing a web application where i need to share web link on facebook.
I have used facebook share button on my page. Below is the share button code which i am using.
<div class="fb-share-button" data-type="button_count" data-share="true" data-width="450" data-show-faces="true" data-href="http://www.housingsutra.com/news-events/the-standard-chunk-of-lorem">
and here is a my app id which i put into head.
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '634793463291263',
xfbml : true,
version : 'v2.2'
});
};
(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>
I also put following meta tags in the top of the page.
<meta property="og:title" content="Housing Sutra" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.housingsutra.com/" />
<meta property="og:image" content="" />
<meta property="og:description" content="" />
There is two condition where i confused.
When I pass the URL for share button with https then its work fine but after clicking on that link from facebook it shows error.
When I pass the URL for share button with http it show authorization error on share box but the link which i share works fine and its not showing any error.
Please help.
I used facebook linter tool for checking your url:
https://developers.facebook.com/tools/debug/og/object/
Your site is not visible its, http protected , try taking url from another ip, you must be bypassing that http://www.housingsutra.com/news-events/the-standard-chunk-of-lorem
When we go to this site it asks username password.