【问题标题】:I could not see the message I posted. Google+ API我看不到我发布的消息。谷歌+ API
【发布时间】:2013-11-12 11:13:37
【问题描述】:

我有一个关于通过 Google+ API 发布消息的问题。 我尝试了以下步骤,但看不到我发布的消息。 我应该怎么做才能成功发布? 另外如果有demo或者示例代码,请告诉我。

我尝试过的步骤:

  1. 按照以下网站上的说明进行操作 http://code.google.com/p/google-api-php-client/ 执行示例/plus/simple.php 在获得个人资料之前,我可以成功。

  2. 将代码添加到示例/plus/simple.php 代码来自这个网站: https://developers.google.com/+/api/latest/moments/insert?hl=ja 没有错误或异常。来自 $plus->moments->insert 的方法返回以下代码, 但我在我的 google+ 时间线上看不到这条消息。


array(5) {
  ["kind"]=>
  string(11) "plus#moment"
  ["type"]=>
  string(37) "http://schemas.google.com/AddActivity"
  ["target"]=>
  array(2) {
    ["kind"]=>
    string(14) "plus#itemScope"
    ["url"]=>
    string(62) "https://developers.google.com/+/plugins/snippet/examples/thing"
  }
  ["result"]=>
  array(1) {
    ["kind"]=>
    string(14) "plus#itemScope"
  }
  ["id"]=>
  string(63) "Eg0xMzg0MjUxOTM3MTYzGJnjm7jHtPWdKykIe5CARCjQCTICEBRCBxi6gpjDhBw"
}
array(5) {
  ["kind"]=>
  string(11) "plus#moment"
  ["type"]=>
  string(37) "http://schemas.google.com/AddActivity"
  ["target"]=>
  array(5) {
    ["kind"]=>
    string(14) "plus#itemScope"
    ["id"]=>
    string(11) "target-id-1"
    ["description"]=>
    string(50) "A page that describes just how awesome Google+ is!"
    ["image"]=>
    string(66) "https://developers.google.com/+/plugins/snippet/examples/thing.png"
    ["name"]=>
    string(20) "The Google+ Platform"
  }
  ["result"]=>
  array(1) {
    ["kind"]=>
    string(14) "plus#itemScope"
  }
  ["id"]=>
  string(75) "Eg0xMzg0MjUxOTM3NzExGJnjm7jHtPWdKzICEBRCBxi6gpjDhBxKEFuVHwoS2gtqh7B5zMyXBB0" 
}

谢谢。 高桥诚

【问题讨论】:

    标签: php google-plus


    【解决方案1】:

    您对moments.insert 的工作原理有点误解。这不会将消息直接插入您的时间线 - 没有公共 API 允许您在没有明确用户批准的情况下执行此操作。

    moments.insert 所做的是创建一个应用活动,该活动将作为您的用户配置文件的一部分存储。获准参与此应用活动的人可以将其视为您的个人资料的一部分,与您的应用相关联,您也可以在那里看到它,但要让它出现在您的时间线上,您必须明确分享它。

    您可以通过转到https://plus.google.com/apps 并选择您的应用来查看您的应用活动。其他人可以通过转到您的个人资料并从您与他们共享的应用列表中选择适当的应用来查看您的应用活动。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-14
      • 1970-01-01
      • 2021-02-01
      • 2011-08-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多