是否可以在Chrome打包应用中使用Chrome网上应用店付款

时间:2014-01-31 12:23:54

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

最近我发现我无法获得打包应用的OAuth令牌。因此提出了一个问题:是否可以使用Chrome网上应用店付款?

{
  "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"
}

1 个答案:

答案 0 :(得分:1)

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

文档

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