2012-08-02 2 views
3

안녕하세요. 내 페이스 북 앱 사용자의 활동을 게시하려고하고 있는데 자습서를 단계별로 따르지만 작동하지 않습니다. 제대로 ...열려있는 그래프를 사용하여 현재 사용자에 대한 정보를 쿼리하려면 활성 액세스 토큰을 사용해야합니다.

경고 메시지에 "오류가 발생했습니다. 현재 사용자에 대한 정보를 쿼리하는 데 활성 액세스 토큰을 사용해야합니다."이유가 무엇입니까? 나는 올바르게 기록된다.

코드는 이것이다 :

<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" 
    xmlns:fb="https://www.facebook.com/2008/fbml"> 
<head prefix="og: http://ogp.me/ns# appnamespace: 
       http://ogp.me/ns/apps/appnamespace#"> 
<title>OG Tutorial App</title> 
    <meta property="fb:app_id" content="appID" /> 
    <meta property="og:type" content="appnamespace:recipe" /> 
    <meta property="og:title" content="Stuffed Cookies" /> 
    <meta property="og:image" content="http://www.domain.com/logo.gif" /> 
    <meta property="og:description" content="The Turducken of Cookies" /> 
    <meta property="og:url" content="http://www.domain.com/activity.php"> 

    <script type="text/javascript"> 
    function postCook() 
    { 
     FB.api(
     '/me/namespace:cook', 
     'post', 
     { recipe: 'http://www.domain.com/activity.php' }, 
     function(response) { 
      if (!response || response.error) { 
       alert('Error occured '+ response.error.message); // it shows "Error occured An active access token must be used to query information about the current user." message 
      } else { 
       alert('Cook was successful! Action ID: ' + response.id); 
      } 
     }); 
    } 
    </script> 
</head> 
<body> 
    <div id="fb-root"></div> 
    <script> 
    window.fbAsyncInit = function() { 
     FB.init({ 
     appId  : 'appID', // App ID 
     status  : true, // check login status 
     cookie  : true, // enable cookies to allow the server to access the session 
     xfbml  : true // parse XFBML 
     }); 
    }; 

    // Load the SDK Asynchronously 
    (function(d){ 
     var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;} 
     js = d.createElement('script'); js.id = id; js.async = true; 
     js.src = "//connect.facebook.net/en_US/all.js"; 
     d.getElementsByTagName('head')[0].appendChild(js); 
    }(document)); 
    </script> 

    <h3>Stuffed Cookies</h3> 
    <p> 
    <img title="Stuffed Cookies" 
      src="http://www.domain.com/logo.gif" 
     /> 
    </p> 

    <br> 
    <form> 
<input type="button" value="Cook" onclick="postCook()" /> 
    </form> 
</body> 
</html> 

답변

관련 문제