0

続く正確な指示をサンプルオープングラフを公開することができません: http://developers.facebook.com/docs/beta/opengraph/tutorial/#publishに従って指示に従って

と取得していますエラー

に行くことができるもの

「のエラーが発生しましたか」?コードは次のとおりです。

==================== ========================

<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# test_app: 
http://ogp.me/ns/apps/test_app#"> 
<meta property="fb:app_id" content="129xxxxxxxxxxxx" /> 
<meta property="og:type" content="test_app:recipe" /> 
<meta property="og:title" content="Stuffed Cookies" /> 
<meta property="og:image" content="http://x.example.com/cookedrcp.jpg" /> 
<meta property="og:description" content="The Turducken of Cookies" /> 
<meta property="og:url" content="http://apps.facebook.com/test_app/index.php"> 

<script type="text/javascript"> 
function postCook() 
{ 
    FB.api('/me/test_app:cook' + 
       '?recipe=http://apps.facebook.com/test_app/index.php','post', 
       function(response) { 
     if (!response || response.error) { 
       alert('Error occured'); 
     } else { 
      alert('Post was successful! Action ID: ' + response.id); 
      } 
    }); 
} 
</script> 
</head> 

<body> 
<div id="fb-root"></div> 
<script src="http://connect.facebook.net/en_US/all.js"></script> 
<script> 
    FB.init({ 
     appId:'129xxxxxxxxxxxx', cookie:true, 
     status:true, xfbml:true, oauth:true 
    }); 
    </script> 

    <fb:add-to-timeline></fb:add-to-timeline> 

    <h3> 
     <font size="30" face="verdana" color="grey"> 
      Stuffed Cookies 
     </font> 
    </h3> 
    <p> 
     <img title="Stuffed Cookies" 
         src="http://x.example.com/cookedrcp.jpg" 
         width="550"/><br /> 
    </p>  

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

=================== ==========================================

私は既にサンプルページごとにオープングラフを作成しています。レシピを調理する。

ご協力いただきますようお願い申し上げます。

+0

どのようなエラーが起こりますか? Facebookのデバッガツール(https://developers.facebook.com/tools/debug)を使用して、facebookがあなたのURLをどのように表示しているのか試しましたか? – Lix

+0

あなたの 'response.error'とは何ですか? –

答えて

0

あなたはユーザーのために有効なaccess_tokenを取得していないと感じています。ドキュメント(https://developers.facebook.com/docs/beta/opengraph/tutorial/#publish)には、あなたのユーザーは既にあなたのアプリケーションに認証されている必要があると言われています。 FB.api()を呼び出す前に、FB.getLoginStatus()を呼び出して現在のユーザが認証されていることを確認してください。

関連する問題