0

我通过 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上登录。我没有看到刚刚插入的那一刻。为什么?

4

1 回答 1

0

我也想知道为什么这些时刻在 google plus 中如此隐藏。

无论如何,这里是您在 google plus 上所有授权应用程序的链接:https: //plus.google.com/apps/ 选择您的应用程序,您会在那里看到精彩瞬间。

于 2013-10-02T15:38:56.663 回答