2011-09-30 6 views
0

누군가 나를 도울 수 있기를 바랍니다. 페이스 북 캔버스 응용 프로그램이 있습니다. 이 코드를 사용하여 인증합니다.자바 스크립트 SDK를 사용하는 캔버스 응용 프로그램

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:[email protected]">[email protected]</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); 
}()); 

내 문제는이 코드를 실행해도 페이스 북 iframe에 내 페이지가 표시되지 않습니다. 그것은 단지 웹 도메인에 머물러 있습니다. 내가 필요한 것은이 페이지를 페이스 북 iframe에 표시하는 것입니다.

이 작업을 수행하려면 무엇을 추가해야합니까?

도움을 주시면 감사하겠습니다.

답변

0

개발자 앱의 캔버스 URL/보안 URL을 캔버스 코드를 가리 키도록 설정 했습니까?

기본적으로 캔버스 폴더에 표시 할 색인 페이지가있는 http://mydomain.com/mycanvasfolder과 같은 도메인을 가리켜 야합니다.

다른 구성이나 FB 작업없이 기본 페이지를 볼 수 있어야합니다.

+0

안녕 Dustin! 네, 그게 전부입니다! – Pascal

+0

페이스 북 설정을 위해 구성된 링크에 액세스하면 직접 응답합니까? 사용중인 코드는 iframe을 통해 작동하거나 웹 사이트를 통해 직접 액세스해야합니다. –

관련 문제