0

I'm trying to use Google's JS API to post on the currently logged in user's stream / wall / whatever. I've gotten to a point where everything seems like it should be working (No errors in my chrome js console) but nothing shows up on my google+ page. My code looks like this:

<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>`

I removed my client_id obviously. I've been looking at this page ( http://wheresgus.com/appactivitiesdemo/ ), which claims that it can make an activity, but even when I test with that, I still don't see anything on my google+ page. Does anyone know what I could be doing wrong?

Thanks for any help.

1 Answer 1

0

App activities appear in a special place on Google+ specific to each app. To see all of your app activities, go to:

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

To see app activities by app, visit here:

http://plus.google.com/apps

And select the app you want to see activities for.

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.