[英]Facebook Canvas application using Javascript SDK
希望有人可以幫助我。 我有一個Facebook canvas應用程序。 我正在使用此代碼進行身份驗證
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中顯示此頁面。
我必須添加些什么才能實現這一目標?
任何幫助表示贊賞!
您是否已在開發人員應用中將畫布URL /安全URL設置為指向您的畫布代碼?
這實際上應該指向您的域,例如http://mydomain.com/mycanvasfolder,canvas文件夾中將包含您要顯示的索引頁。
您應該能夠看到沒有任何其他配置或FB內容的基本頁面。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.