【问题标题】:API to make public Google Hangout Url用于公开 Google Hangout Url 的 API
【发布时间】:2015-12-23 20:51:12
【问题描述】:

我有一个私人网页。我想从该页面提供一个 Google Hangout 链接。

知道链接的任何人都被“授权”使用环聊。我希望他们不必登录(如果他们已经登录也可以)。这是额外的工作和失败的机会。

如何创建公开的 Google Hangout 链接?两个人约会的方式?我可以在哪里传递一个roomId。我查看了环聊 API,但没有看到如何添加它。

环聊 URL 有 135 位,因此看起来足够随机以确保安全。我写了这个函数,但它大部分都不起作用,而且当它发生时,环聊是不公开的。

  newHangoutsUrl: function() {
    /* Hangout urls can be made on the fly:
     *     https://plus.google.com/hangouts/_/{roomId}
     *
     * Where roomId = 27 random chars from set '234567abcdefghijklmnopqrstuvwxyz'
     *
     * this is called on client so we use Math.random();
     */
    var set = '234567abcdefghijklmnopqrstuvwxyz'.split('');
    var ret = '';
    for (var i=0; i<27; i++) {
      ret += set[Math.floor(Math.random()*set.length)];
    }
    return 'https://plus.google.com/hangouts/_/' + ret;
  },

有什么建议吗?

【问题讨论】:

    标签: hangout hangouts-api


    【解决方案1】:

    您可能应该只使用页面中的Hangout Button,因为无法以编程方式生成/使用环聊 URL。您可以使用 Invites 将人员添加到环聊。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-02-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-21
      • 1970-01-01
      • 2015-02-05
      • 1970-01-01
      相关资源
      最近更新 更多