-1

我试图遵循 facebook 的示例教程:developers.facebook.com/docs/opengraph/tutorial/#debug

但是在我完成并单击烹饪按钮后,它显示“发生错误”。

您可以在此处查看该应用程序:http ://www.akashbc.com/facebookapp/index.html

以下是应用程序的页面来源:

<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"> 

<head prefix="og: http://ogp.me/ns# og_recipebox: http://ogp.me/ns/apps/abcrecipelist#"> 
    <meta property="fb:app_id" content="258611890922127" /> 
    <meta property="og:type" content="abcrecipelist:recipe" /> 
    <meta property="og:title" content="Oreo Stuffed Cookies" /> 
    <meta property="og:image" content="http://1.bp.blogspot.com/-92sA7pC51pg/T9CKdHHeDzI/AAAAAAAACbg/MRq4PR2P5QQ/s1600/jQuery_Cookies.jpg" /> 
    <meta property="og:description" content="The Turducken of Cookies" /> 
    <meta property="og:url" content="http://www.akashbc.com/facebookapp/index.html"> 

    <script type="text/javascript">
    function postCook()
    {
        FB.api('/me/abcrecipelist:cook&recipe=http://www.akashbc.com/facebookapp/index.html','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:'258611890922127', 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="Oreo Stuffed Cookies" src="http://1.bp.blogspot.com/-92sA7pC51pg/T9CKdHHeDzI/AAAAAAAACbg/MRq4PR2P5QQ/s1600/jQuery_Cookies.jpg" width="550"/><br />
        </p>       

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

        <fb:activity actions="YOUR_NAMESPACE:cook"></fb:activity>
    </body> 
</html>

另外这里是应用程序基本设置的截图:

请告诉我有什么问题。。

提前致谢 :)

4

1 回答 1

0

您的 API 调用不正确:

FB.api('/me/abcrecipelist:cook&recipe=http://www.akashbc.com/facebookapp/index.html' ...

应该

FB.api('/me/abcrecipelist:cook?recipe=http://www.akashbc.com/facebookapp/index.html' ...

&应该是? .

于 2012-08-24T08:48:35.557 回答