Facebook FB提要方法在共享图像和url时无法正常工作
我正试图分享来自FB应用程序的图像,使用发送对话框,就像我过去几年所做的那样Facebook FB提要方法在共享图像和url时无法正常工作,facebook,facebook-javascript-sdk,Facebook,Facebook Javascript Sdk,我正试图分享来自FB应用程序的图像,使用发送对话框,就像我过去几年所做的那样 var obj = { method: 'feed', link: 'https://www.facebook.com/pages/TESTPAGE?sk=app_XXXXXXXXXXXXXX&app_data=share|10', caption: '', name: 'Title for share', description: 'description fort share', p
var obj = {
method: 'feed',
link: 'https://www.facebook.com/pages/TESTPAGE?sk=app_XXXXXXXXXXXXXX&app_data=share|10',
caption: '',
name: 'Title for share',
description: 'description fort share',
picture: IMG_URL
};
我提供了2个截图
当我点击应用程序内部的共享按钮时
我一直在我的个人资料墙上
直到几个月前,FB还会显示来自feed方法的数据,但现在,feed的行为就像share方法一样:它共享url,没有我通过feed对话框发送的图像和标签
我只想从应用程序中共享图像,该图像的url应该指向应用程序url。
有什么建议吗?我昨天就遇到了这个问题。只有当您将FB应用程序链接url传递到链接选项时,才会发生此问题。只要链接url与FB没有任何关系,就可以很好地处理图像 因此,我找到的解决办法是从谷歌获得一个缩短的URL,并传递它,而不是普通的应用程序链接
FB.ui({
name: 'temp',
method: 'feed',
picture: '',
link: '{shortened url}',
caption: 'temp',
description: 'temp',
redirect_uri: 'any url'
}, function(response){
});
您可以尝试以下代码从FB应用程序共享图像:
FB.ui(
{
method: 'feed',
display: 'popup', // must be one of "popup", "dialog", "iframe", "touch", "async", "hidden", or "none"
name: 'Title for share',
description: 'Description for share',
caption: 'www.facebook.com/YourFbPage/app_xxxxxxxxxxxxxxxxxxx',
link: 'http://PathToYourDomain.com/Folder/',
picture: 'http://PathToYourDomain.com/Folder/img/img-1200x627.jpg',
},function(response) {
if (response && response.post_id) {
// alert('Post was published.');
} else {
// alert('Post was not published.');
}
}
);
祝你好运 我只是无意中发现了你的帖子,因为我有完全相同的效果。我想Facebook上有一个bug。我将创建错误报告并向您发送链接以支持它。请登录并确认错误:Facebook团队确认这是一个错误,所以我们只需等待:)。谢谢,我花了好几个小时试图找出问题所在。我甚至做了一些变通办法:)@FlyLord您是否在“设置”(迁移选项卡)中将提要url安全设置设置为“开”?我没有该应用程序的选项卡。几个星期前我开发了这个应用程序,因为这是facebook端的一个bug:S
FB.ui({
method: 'share_open_graph',
action_type: 'og.shares',
action_properties: JSON.stringify({
object : {
'og:url': str_href,
'og:title': 'title', //galleryItem.title,
'og:description': 'desc', //galleryItem.description,
'og:og:image:width': '2560',
'og:image:height': '960',
'og:image': str_picture //BASE_URL + '/images/works/galleries'
}
})
});