javascript - Google Plus JS API AddActivity -
i'm trying use google's js api post on logged in user's stream / wall / whatever. i've gotten point seems should working (no errors in chrome js console) nothing shows on google+ page. code looks 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 test", description: "hi there, 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 client_id obviously. i've been looking @ page ( http://wheresgus.com/appactivitiesdemo/ ), claims can make activity, when test that, still don't see on google+ page. know doing wrong?
thanks help.
app activities appear in special place on google+ specific each app. see of app activities, go to:
https://plus.google.com/apps/activities
to see app activities app, visit here:
and select app want see activities for.
Comments
Post a Comment