【问题标题】:Invalid credentials (missing or invalid oAuth token) on google plus share interactive post using javascript render methodgoogle 上的无效凭据(缺少或无效的 oAuth 令牌)以及使用 javascript 呈现方法共享交互式帖子
【发布时间】:2015-01-04 05:40:08
【问题描述】:

一切正常。但是当我在谷歌点击浏览人物图标并分享交互式帖子时,它只显示无效凭据(缺少或无效的 oAuth 令牌)。正如这张图片中提到的

我使用以下代码进行交互式帖子。

<html>
  <head>
    <title>Share Demo: Deferred execution with language code</title>
    <link rel="canonical" href="http://www.example.com" />
  </head>
  <body>
  <script>
  window.___gcfg = {
            lang: 'en-US',
            parsetags: 'explicit'
          };
  </script>
  <script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>
    <div id ="sharePost">Share</div>
 <script>
     (function() {
           var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
           po.src = 'http://apis.google.com/js/client:platform.js';
           var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
         })();
     var options = {
                contenturl: 'http://www.google.com',
                contentdeeplinkid: '/pages',
                clientid: 'xxxxxxxxxxxx.apps.googleusercontent.com',
                cookiepolicy: 'single_host_origin',
                prefilltext: 'Hai happy friday'+ Math.random(),
                calltoactionlabel: 'INVITE',
                calltoactionurl: 'http://www.google.com'
              };
              // Call the render method when appropriate within your app to display
              // the button.
              gapi.interactivepost.render('sharePost', options);

      </script>
  </body>
</html>

【问题讨论】:

  • 我建议在这篇文章中添加大量信息,因为我们无法从一堆屏幕截图中猜出你的问题是什么。我们需要一个指向您尝试实现的东西以及您拥有的代码的链接。没有这个,我的投票很接近。
  • 我用我用过@spender的编码编辑了我的帖子

标签: javascript oauth google-plus


【解决方案1】:

google 的文档是最新的。实现交互式帖子很容易并且很好解释。 如果它不起作用:

  1. 这是 Google 代码中的错误(我认为是这里)
  2. 这是 Google 文档中的一个错误,不是最新的

在所有情况下,罪魁祸首都是谷歌! :)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-12
    • 2011-11-27
    • 1970-01-01
    • 2012-04-09
    • 2021-11-01
    • 1970-01-01
    相关资源
    最近更新 更多