0
votes

I have developed a web application with Google+ Signin. Once user click the sign in with Google+ it authorize the app and register that user. after that process, I want to automatically share some information in google plus wall from my application. For that I go through the Google plus API, "https://developers.google.com/+/" and enables api's related to login, get user information and write access. I'm trying to use Google's API to post on the currently logged in user's stream / wall / whatever. My website uses Facebook and twitter APIs to post notifications automatically on the currently logged in user's wall, but not able to post with Google's wall. I want something like Facebook and Twitter API, with Automatic Posting function and API. Please help me to troubleshoot this problem. For your review I am sending my sample code snippet here:

/*
<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: "XXXXXXXXXXX",
            immediate: false,
            response_type: "token",
            scope: ["https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/plus.stream.write"],
            requestvisibleactions: "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: {
                        type: "http://schema.org/Thing",
                        name: "Test Name",
                        description: "Test Description",
                        image: "http://test.test.com/Deal/Dealphoto/Thumbnail/0160475582922191382013.png"
                    }
                })
            }).execute(function(e) {
                console.log("did it.", e);
            });
        });
    }
</script>

*/

I will be very thankful to you for this.

Thanks, Lalit

1

1 Answers

1
votes

Basically you can't automatically post to a users Google+ stream. You can either use the share API with your users intentionally posting, or you can use app activities to automatically create posts that won't be visible on the users stream.

There is an open feature request you can star for a full write API method.

There is a write API in the Domains API but that only works for Google Apps users and can only post private content in that company.