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+ ページには何も表示されません。私が間違っている可能性があることを誰かが知っていますか?
助けてくれてありがとう。