我的应用程序使用 Facebook 身份验证:
FB.init({
appId: config.fbAppId,
status: true,
cookie: true,
// xfbml: true,
// channelURL : 'http://WWW.MYDOMAIN.COM/channel.html', // TODO
oauth : true
});
// later...
FB.login(function(response)
{
console.log(response);
console.log("authId: " + response.authResponse.userID);
gameSwf.setLoginFacebook(response.authResponse.accessToken);
}, {scope:'email,publish_actions,read_friendlists'});
使用它时,人们可以在墙上发帖:
var obj = {
method: 'feed',
link: linkUrl,
picture: pictureUrl,
name: title,
caption: "",
description: message
};
function callback(response) {
// console.log("Post on wall: " + response);
}
FB.ui(obj, callback);
这工作正常,但有一点小问题。如果人们:
- 登录应用程序。
- 退出 Facebook。
- 尝试从应用程序发布墙帖。
打开墙帖对话框失败。控制台显示“拒绝显示文档,因为 X-Frame-Options 禁止显示。 ”。
我可以让 Facebook 向用户显示登录提示吗?或者我可以检测到错误并告诉用户他不再登录 Facebook?