我现在做的事情:
FB.ui(
{
method: 'stream.share',
display: 'iframe',
u: url
},
function (response) {
//console.log(response);
}
);
这正是我所需要的,但它会打开一个弹出窗口,而不是像窗口那样漂亮的灯箱。
答案 0 :(得分:0)
使用方法feed
代替stream.publish
。示例代码:
var share = {
method: "feed",
name: "Lorem ipsum dolor sit amet!",
link: "http://www.google.com/",
picture: "http://placekitten.com/95/95",
caption: "Claritas est etiam processus dynamicus.",
description: "Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram."
};
FB.ui(share, function(response) {
if (response && response.post_id) {
console.log("Callback for FB share:", response);
} else {
console.log("Share was not made.");
}
});
答案 1 :(得分:0)
我有类似的问题。致电FB.init
时,请务必设置status: true
。在https://developers.facebook.com/docs/javascript/quickstart/v2.2
设置status: true
尝试在登录时获取有关用户的信息。我想如果在调用FB.ui
之前用户是已知的,它将使用对话框而不是弹出窗口。我能够看到桌面应用程序的对话框,但不是我认为是设计的移动设备。