[英]Facebook Canvas application using Javascript SDK
Hope someone can help me out. 希望有人可以帮助我。 I have a facebook canvas application. 我有一个Facebook canvas应用程序。 I'm using this code to authenticate 我正在使用此代码进行身份验证
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);
}());
My problem is, running this code doesn't show my page in a facebook iframe. 我的问题是,运行此代码不会在facebook iframe中显示我的页面。 it just stays on the web domain. 它只是停留在网络域上。 What I need is to get this page shown in a facebook iframe. 我需要在Facebook iframe中显示此页面。
What do I have to add to make this happen? 我必须添加些什么才能实现这一目标?
Any help is appreciated! 任何帮助表示赞赏!
Have you set your canvas url/secure url in the developer app to point to your canvas code? 您是否已在开发人员应用中将画布URL /安全URL设置为指向您的画布代码?
This should essentially point to your domain like http://mydomain.com/mycanvasfolder where the canvas folder would have the index page you want to show. 这实际上应该指向您的域,例如http://mydomain.com/mycanvasfolder,canvas文件夹中将包含您要显示的索引页。
You should be able to see a basic page without any other configuration or FB stuff. 您应该能够看到没有任何其他配置或FB内容的基本页面。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.