【问题标题】:Is it possible to use Chrome Web Store Payments in chrome packaged apps是否可以在 chrome 打包应用程序中使用 Chrome Web Store Payments
【发布时间】:2014-02-24 03:28:55
【问题描述】:

最近我发现我无法获取打包应用程序的 OAuth 令牌。于是提出了一个问题:是否可以使用 Chrome Web Store Payments?

{
  "manifest_version": 2,
  "name": "Animation Editor",
  "version": "0.139.3",

  "description": "animation editor",
  "icons": {"128": "logo.png" },
  "app": {
    "background": {
        "scripts": ["start.js"],
        "persistent": false
    }
  },
  "permissions": [
    "identity",
    "https://www.googleapis.com/"
  ],
    "oauth2": {
    "client_id": "361228830972.apps.googleusercontent.com",
    "scopes": [
      "https://www.googleapis.com/auth/chromewebstore.readonly"
    ]
  },
  "short_name": "aEditor"
}

【问题讨论】:

    标签: google-chrome google-chrome-extension oauth google-chrome-devtools google-chrome-app


    【解决方案1】:

    您在哪里发现无法将 OAuth 与打包应用一起使用?该文档确实承认,对于打包的应用程序,由于用户下载源代码,因此操作源代码相对容易,但您仍然可以使用 API。

    文档

    基本上,在 Chrome APIs Console 中设置应用 ID 后,您可以在 Chrome 身份 API 中使用 getAuthToken 调用来验证用户帐户。然后,您可以将该令牌信息传递给 Licensing API 以进行付款(通过 Chrome 网上应用店)或验证。

    【讨论】:

    • 在您发布的最后一个文档中写入了然后我应该能够在仪表板中获取 OAuth 令牌。但我不能 - 没有链接 OAuth 设置!!!因此,我假设本文档适用于未打包的应用程序。您知道获取 OAuth 令牌的另一种方式吗?还是我真的不需要?
    • 您在哪个地区设置应用程序?您需要在 Google 的supported regions 之一中才能使用网上应用店进行付款。获取令牌的另一种选择是使用来自 Identity API 的 launchWebAuthFlow,但您需要自己的方式来验证用户身份。
    • 我假设您已经使用Google API Console 注册了您的应用程序?如果您还没有这样做,您需要先注册,然后该应用才会显示在您的仪表板中。
    • 您会发布更新后的manifest.json 文件吗?这将帮助我找出问题所在。
    猜你喜欢
    • 2015-07-23
    • 2014-10-31
    • 1970-01-01
    • 2013-11-26
    • 2015-10-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-09
    相关资源
    最近更新 更多