I have a web application which uses the Facebook Send button on a per campaign basis, we used the functionality as described below last about 4 weeks ago.
The full reproduction example is here:
<html>
<head>
<title>Your Website Title</title>
<!-- You can use open graph tags to customize link previews.
Learn more: https://developers.facebook.com/docs/sharing/webmasters -->
<meta property="og:url" content="https://managedhosting.partners/fb.html" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Your Website Title" />
<meta property="og:description" content="Your description" />
<meta property="og:image" content="https://managedhosting.partners/wp-content/uploads/2020/07/engineering.png" />
</head>
<body>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '474334713680098',
autoLogAppEvents : true,
xfbml : true,
version : 'v10.0'
});
};
function fb(){
FB.ui({
method: 'send',
link: 'https://comp.aquila.com.au/',
});
}
</script>
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js"></script>
<a href="#" onclick="fb();">click</a>
</body>
</html>
When clicking the link to trigger the send button I get an error in the browser console:
I though at first this is some deprecation, as we were using v2.11 of the SDK, but its also reproducible with the v10.0 SDK. I've also made live our campaign page from 4 weeks ago which shows the same behaviour.
I've made sure our Facebook App is live and I have also created an App in a fresh account to make sure its nothing to do with the account.
The Facebook UI call now seems to require a callback function, this can be seen in the examples, but its not shown on the quickstart page initially
The complete working code example becomes then:
<html>
<head>
<title>Your Website Title</title>
<!-- You can use open graph tags to customize link previews.
Learn more: https://developers.facebook.com/docs/sharing/webmasters -->
<meta property="og:url" content="https://managedhosting.partners/fb.html" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Your Website Title" />
<meta property="og:description" content="Your description" />
<meta property="og:image" content="https://managedhosting.partners/wp-content/uploads/2020/07/engineering.png" />
</head>
<body>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '474334713680098',
autoLogAppEvents : true,
xfbml : true,
version : 'v10.0'
});
};
function fb(){
FB.ui({
method: 'send',
link: 'https://comp.aquila.com.au/',
}
, function(response){}) //<!-------------
);
}
</script>
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js"></script>
<a href="#" onclick="fb();">click</a>
</body>
</html>