Facebook 发送中断
Facebook Send broken
我有一个 Web 应用程序,它在每个活动的基础上使用 Facebook 发送按钮,我们在大约 4 周前使用了如下所述的功能。
完整的复制示例在这里:
<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>
单击 link 触发发送按钮时,浏览器控制台出现错误:
虽然起初这是一些弃用,因为我们使用的是 SDK 的 v2.11,但它也可以使用 v10.0 SDK 重现。我还启用了 4 周前的活动页面,该页面显示了相同的行为。
我已确保我们的 Facebook 应用程序已上线,并且我还在新帐户中创建了一个应用程序以确保它与该帐户无关。
Facebook UI调用现在好像需要回调函数,这个可以在examples, but its not shown on the quickstart page最初
看到
完整的工作代码示例变为:
<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>
我有一个 Web 应用程序,它在每个活动的基础上使用 Facebook 发送按钮,我们在大约 4 周前使用了如下所述的功能。
完整的复制示例在这里:
<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>
单击 link 触发发送按钮时,浏览器控制台出现错误:
虽然起初这是一些弃用,因为我们使用的是 SDK 的 v2.11,但它也可以使用 v10.0 SDK 重现。我还启用了 4 周前的活动页面,该页面显示了相同的行为。
我已确保我们的 Facebook 应用程序已上线,并且我还在新帐户中创建了一个应用程序以确保它与该帐户无关。
Facebook UI调用现在好像需要回调函数,这个可以在examples, but its not shown on the quickstart page最初
看到完整的工作代码示例变为:
<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>