【问题标题】:why read action in open graph not submit为什么在打开的图表中读取操作不提交
【发布时间】:2012-07-16 10:59:51
【问题描述】:

我创建了一个应用程序,一个对象(文章)一个动作(读取),我想测试发布,但我总是提交警报“发生错误”。为什么?

头代码

<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/fb/article#">
  <meta property="fb:app_id" content="xxxxxxxxxx" />
  <meta property="og:type" content="article" />
  <meta property="og:url" content="object_url" />
  <meta property="og:title" content="Tachnomo" />
  <meta property="og:description" content="Drive car" />
  <meta property="og:image" content="https://s-static.ak.fbcdn.net/images/devsite/attachment_blank.png" />

和javascript

<script type="text/javascript">
  function readnews()
  {
      FB.api(
        '/me/news.reads?article=object_url',
        'post',
        function(response) {
           if (!response || response.error) {
              alert('Error occured');
           } else {
              alert('Drive was successfully published with ID : ' + response.id);
           }
        });
  }
  </script>

【问题讨论】:

  • 什么错误?给我们一些可以合作的东西。

标签: php javascript facebook-graph-api facebook-opengraph


【解决方案1】:

“object_url”应该是一个编码的 URL,而不是“object_url”这个词。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-05-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多