【发布时间】:2014-09-19 11:51:19
【问题描述】:
我想在我的网页上使用 Google+ 交互式帖子。我按照here的说明实现了这个功能。一切正常。但是,如果用户想要选择要与之共享帖子的人或圈子,则会弹出错误消息“无效凭据(缺少或无效的 oAuth 令牌)”。控制台在 Google 服务器上的文件 picker.js 中显示错误“未定义对象初始化”。我只使用 Google+ 交互式帖子功能(如在 this presentation video 中)创建了空白页面,但结果相同。
我有什么问题吗?或者这个错误是在谷歌方面?
这是在 G+ 上通过预定义消息分享帖子的另一种方式?
感谢您的回复,抱歉我的英语不好。
代码示例:
<!DOCTYPE thml>
<html>
<head>
<title>Example</title>
</head>
<body>
<button
class="g-interactivepost"
data-contenturl="http://www.mediasolution.cz"
data-contentdeeplinkid="/"
data-clientid="xxx.apps.googleusercontent.com"
data-cookiepolicy="single_host_origin"
data-prefilltext="Message for friends."
data-calltoactionlabel="REGISTER"
data-calltoactionurl="http://www.mediasolution.cz"
data-calltoactiondeeplinkid="/">
Share
</button>
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/client:plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</body>
</html>
【问题讨论】:
-
您是否在使用多个不同的浏览器和多个不同的 Google 帐户时遇到相同的错误?
-
是的,我尝试了 2 个 Google 帐户和所有主要浏览器(FF、IE、Chrome),结果相同。
-
invite your friends 示例对您有用吗?您有我们可以尝试的托管测试用例吗?
-
是邀请你的朋友作品,但我找不到区别。我发现了其他几个非功能性网站(例如:mashable)。这是我的sample app。
标签: oauth google-api google-plus