0

我正在尝试使 Open Graph 工作。在应用程序的管理中,我有以下两项:

Action Types: write - note
Object Types: note

我不知道为什么,但 Open Graph 仍然无法正常工作。我按照教程进行操作,但是当我按下按钮时,仍然出现错误

相关代码:

     <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# my_url: http://ogp.me/ns/fb/my_url#">
  <meta property="fb:app_id" content="ID" /> 
  <meta property="og:type"   content="note" /> 
  <meta property="og:url"    content="http://google.com" /> 
  <meta property="og:title"  content="Sample text" /> 
  <meta property="og:image"  content="https://s-static.ak.fbcdn.net/images/devsite/attachment_blank.png" /> 

<script type="text/javascript">
  function postCook()
  {
      FB.api(
        '/me/my_url:write',
        'post',
        { note: 'http://google.com' },
        function(response) {
           if (!response || response.error) {
              alert('Error occured');
           } else {
              alert('Cook was successful! Action ID: ' + response.id);
           }
        });
  }
</script>
      <script>
        window.fbAsyncInit = function() {
          FB.init({
            appId      : 'ID', // 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>

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

我整天都在玩 Open Graph 的设置,但仍然找不到正确的配置。

想念我重要的东西?或者我怎样才能深入调试这个基本应用程序?

编辑错误消息说:

code: 2500
message: "Unknown path components: /my_url:write"
type: "OAuthException"

此外,当我打开链接(来自 Facebook 开发人员管理)时,应该在哪里显示所有操作,只有:

{
   "data": [

   ]
}
4

0 回答 0