use*_*610 5 parameters jquery facebook sharing fb.ui
今天,我检查了我的网站,此代码不起作用:
<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>
Run Code Online (Sandbox Code Playgroud)
使用以下代码,来自https://developers.facebook.com/docs/sharing/reference/share-dialog/:
FB.ui({
method: 'share',
href: link,
}, function(response){});
Run Code Online (Sandbox Code Playgroud)
Facebook看到链接的照片,但没有我需要分享的照片。显然,FB更改了共享策略。
现在如何自定义参数共享对象?如果此链接包含很多图片,如何设置自定义图像?
已编辑
如果没有og:url,它将再次起作用,但是单击成功后,在Facebook上共享了内容,重定向到了板载url上,而不是需要共享的url上。
| 归档时间: |
|
| 查看次数: |
621 次 |
| 最近记录: |