0

Google の JS API を使用して、現在ログインしているユーザーのストリーム / ウォールなどに投稿しようとしています。すべてが機能しているように見えるところまで来ましたが (chrome js コンソールにエラーはありません)、Google+ ページには何も表示されません。私のコードは次のようになります。

<html>  
    <head>
    <title>Google+ API Test</title>
    <script type="text/javascript">
        function googleAPIOnLoad() {
            console.log("Google plus js loaded... calling client.load...");
            gapi.client.load('plus','v1', function(e){
                console.log("client loaded...");
                console.log(e);
            });
        }

        function signIn() {
            console.log("signing in...");
            gapi.auth.authorize({
                client_id: "YOUR_CLIENT_ID",
                immediate: false,
                response_type: "token",
                scope: ["https://www.googleapis.com/auth/plus.login"],
                request_visible_actions: "https://schemas.google.com/AddActivity"
            }, function(e) {
                // callback
                console.log("done!", e);

                gapi.client.request({
                    path: "plus/v1/people/me/moments/vault",
                    method: "POST",
                    body: JSON.stringify({
                        type: "http://schemas.google.com/AddActivity",
                        target: {
                            id: "SOME_UNIQUE_ID_12345",
                            type: "http://schema.org/Thing",
                            name: "This is a test",
                            description: "Hi there, this is a test",
                            image: "http://mentationaway.com/wp-content/uploads/2010/08/fractal.jpg"
                        }
                    })
                }).execute(function(e) {
                    console.log("did it.", e);
                });
            });
        }
    </script>
    <script type="text/javascript" src="https://apis.google.com/js/client:plusone.js?onload=googleAPIOnLoad"></script>
</head>
<body>
    <input type="button" value="Sign In" onclick="signIn()">
</body>
</html>`

明らかに client_id を削除しました。このページ ( http://wheresgus.com/appactivitiesdemo/ )を見てきましたが、アクティビティを作成できると主張していますが、それでテストしても、Google+ ページには何も表示されません。私が間違っている可能性があることを誰かが知っていますか?

助けてくれてありがとう。

4

1 に答える 1

0

アプリのアクティビティは、各アプリ固有の Google+ の特別な場所に表示されます。アプリのすべてのアクティビティを表示するには、次の場所に移動します。

https://plus.google.com/apps/activities

アプリごとのアプリ アクティビティを確認するには、次の URL にアクセスしてください。

http://plus.google.com/apps

アクティビティを表示するアプリを選択します。

于 2013-08-13T02:11:59.877 に答える