我通过Google + php API插入了很多片刻。 这些是我的代码。
$client = new Google_Client();
$client->setClientId($client_id);
$client->setClientSecret($client_ecret);
$client->setRedirectUri($redirect_uri);
$requestVisibleActions = array(
'http://schemas.google.com/AddActivity',
'http://schemas.google.com/ReviewActivity',
'http://schemas.google.com/CreateActivity');
$client->setRequestVisibleActions($requestVisibleActions);
$plus = new Google_PlusService($client);
if (isset($_GET['code'])) {
//https://www.googleapis.com/auth/userinfo.email
$client->authenticate($_GET['code']);
}
if ($client->getAccessToken()) {
$moment_body = new Google_Moment();
$moment_body->setType("http://schemas.google.com/CreateActivity");
$item_scope = new Google_ItemScope();
Zend_Log::INFO);
$item_scope->setId('1343');
$item_scope->setType("http://schemas.google.com/CreateActivity");
$item_scope->setType("http://schema.org/CreativeWork");
$item_scope->setName("Test");
$item_scope->setDescription(“This is just a test.”);
$moment_body->setTarget($item_scope);
$momentResult = $plus->moments->insert('me', 'vault', $moment_body);
回复如下:
array(5) { ["kind"]=> string(11) "plus#moment" ["type"]=> string(40) "http://schemas.google.com/CreateActivity" ["target"]=> array(4) { ["kind"]=> string(14) "plus#itemScope" ["id"]=> string(4) "1343" ["description"]=> string(20) "This is just a test." ["name"]=> string(4) "Test" } ["result"]=> array(1) { ["kind"]=> string(14) "plus#itemScope" } ["id"]=> string(75) "Eg0xMzc1NTE2ODc2MDYzGJGDxrC2ufClwgEyAhABQgYYofONXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" }
似乎这些时刻已成功发布。正确?
问题是我能看到它的地方。 我登录Google Plus。我没有看到刚插入的那一刻。为什么呢?
答案 0 :(得分:0)
我也想知道为什么这些时刻在谷歌加上如此隐藏。
无论如何,这是指向Google +上所有授权应用的链接:https://plus.google.com/apps/ 选择你的应用程序,你会看到那里的时刻。