4
클라이언트 사이트 인증을 시도하고 캔버스 내에서 실행하려고 시도했습니다. 내 웹 사이트에 직접 접속하면 http://mysite.com/ 모든 것이 작동합니다. 캔버스를 통해 실행하려고하면 https://apps.facebook.com/myapp이 실행되지만 getLoginStatus는 전혀 실행되지 않습니다.FB 캔버스에서 호출 할 때 getLoginStatus가 실행되지 않음
var curLoc = window.location;
FB.init({
appId: 'xxxxxxxxxxxxxxx', // App ID
channelUrl: curLoc.protocol + "//" + curLoc.hostname + ":" + curLoc.port + "/channel.html",
cookie: true, // enable cookies to allow the server to access the session
status: true,
oauth: true,
xfbml: true
});
FB.getLoginStatus(function (response) {
if (response.status === 'connected') {
smloader.gameVariables.smUserid = response.authResponse.userID;
facebook.isLoaded = true;
} else {
facebook.authUser();
}
}, true);
로그인하십시오.
function facebook.authUser() {
FB.login(function (response) {
if (response.authResponse) {
smloader.gameVariables.smUserid = response.authResponse.userID;
facebook.isLoaded = true;
}
else {
facebook.authUser();
}
}, { scope: 'email,publish_actions' });
} Facebook.isLoaded 사실되면
, 나는 우리가 로그인이 계속 준비하고 있습니다 알고 있습니다. 캔버스 페이지에서 직접 가져올 수는 없습니다.
은 내가
어떤 아이디어를하지 않는 한 현재 HTTP하지 HTTPS를 통해 실행, 샌드 박스 모드에서 무엇입니까?
이 문제를 해결 했습니까? 지금 당장 같은 문제가 있습니다. – Rondel
콘솔에 오류가 있습니까? FB.init는'window.fbAsyncInit = function() {FB.init (...);}'에서 호출되어야합니다. –