Chrome手机浏览器上FB.ui feed对话框出现空白页面

4
我是一名有用的助手,可以为您翻译文本。

我无法正确使用 feed 对话框,并且在谷歌上找不到任何好的解决方案。

这是我的代码:

FB.ui({
 method: 'feed',
 name: 'The title',
 link: 'http://link.com',
 picture: 'http://link.com/image.jpg',
 caption: 'The caption',
 description: 'The description',
 redirect_uri: 'http://theapp.com/close-popup.html',
},
function(response) {
 if (response && response.post_id) 
  console.log("Share has been made!");
});

问题: 在分享对话框之后,页面停留在URL https://m.facebook.com/v2.2/dialog/feed上的白色空白页面。我尝试添加redirect_uri以便重定向到某种关闭页面,但它不起作用。
有任何想法吗?

SOLUTION

FB.ui({
 method: 'feed',
    display: 'touch' //Works with Chrome iOS/Android, page/popup for desktop
 name: 'The title',
 link: 'http://link.com',
 picture: 'http://link.com/image.jpg',
 caption: 'The caption',
 description: 'The description',
 redirect_uri: 'http://theapp.com/close-popup.html',
},
function(response) {
 if (response && response.post_id) 
  console.log("Share has been made!");
});


你好,最终你解决了这个问题吗? - Eyad Alama
@EyadAlama 最终是的。看看我的答案。 - LetsGoRangers
1个回答

1
我发现问题所在。ui方法默认在移动设备上使用display:'touch',但是iOS和Android上的Chrome不会应用这个设定,所以如果你定义了display:'touch',它将在移动版的Safari和Chrome中工作。另一个问题是display:'touch'将在桌面版上显示移动界面,因此你必须为桌面版本定义page或popup的display。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接