【发布时间】:2011-10-01 02:57:15
【问题描述】:
希望有人可以帮助我。我有一个 facebook 画布应用程序。我正在使用此代码进行身份验证
window.fbAsyncInit = function() {
FB.init({ appId: '123842974364777',
status: true,
cookie: true,
xfbml: true,
oauth: true});
this.vars = {
access_token: '',
album_id: '',
items: '',
user_id: '',
photo_path: '',
errorHandler: 'There was a problem posting your picture!<br> Please contact <a href="mailto:support@eshots.com">support@eshots.com</a>',
counter: 1
}
authenticate();
function authenticate() {
FB.getLoginStatus(function(response) {
if(response.authResponse) {
// logged and known to app
// store access token
vars.access_token = response.authResponse.accessToken;
sendUserInformation();
} else {
// not logged in or unknow to app
// prompt user to authorize app
FB.login(function(response) {
if(response.authResponse) {
// store access token
vars.access_token = response.authResponse.accessToken
sendUserInformation();
}
}, {scope: 'email,read_stream,user_birthday,user_photos,publish_stream'});
}
});
}
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol
+ '//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
我的问题是,运行此代码不会在 facebook iframe 中显示我的页面。它只是停留在网络域上。我需要的是让这个页面显示在 facebook iframe 中。
我必须添加什么才能做到这一点?
感谢任何帮助!
【问题讨论】:
标签: javascript facebook sdk oauth