今天我检查了我的网站,发现这段代码不起作用:
<script>
...
FB.ui({
display: 'dialog',
method: 'share_open_graph',
action_type: 'og.likes',
hashtag: '#Testing',
action_properties: JSON.stringify({
object: {
'og:image': img,
'og:image:secure_url': img,
'og:image:type': 'image/jpeg',
'og:image:width': w,
'og:image:height': h,
'og:image:alt': img,
'og:url': link,
'og:title': title,
'og:description': desc,
'fb:admins': fbadmin
}
})
},
function(response) {
if (typeof response != 'undefined') {
//Success
} else {
//Not Success;
}
});
</script>
使用此代码,来自 https://developers.facebook.com/docs/sharing/reference/share-dialog/ :
FB.ui({
method: 'share',
href: link,
}, function(response){});
Facebook 看到并拍摄了链接 的照片,但不是我需要分享的照片。 显然 FB 改变了分享政策。
现在如何自定义共享参数?如果此链接有很多图片,如何设置自定义图片?
已编辑
在没有 og:url 的情况下,它再次工作,但在点击成功后在 facebook 上共享内容,重定向到 board url,而不是我需要共享的 url。
最佳答案
我今天也遇到了这个问题,我的解决方案是从打开的图形对象中删除 'og:url': 链接,然后它再次工作。不过我只有 url、标题、描述和图片。
关于jquery - Facebook 通过 FB.ui 停止自定义参数(图像、标题、描述)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55870767/