我有一个离线 Chrome Web 应用程序,想通过网上商店进行销售。
它有一个服务器后端。我希望服务器检查许可证数据。我该怎么做?
这是API 。这是 Java HowTo 。这是 OAuth-JWT lib for nodejs 。我按照库的自述文件中的描述创建了一个新的客户端 ID。
我收到这样的回复:
{ error:
{ errors: [ [Object] ],
code: 403,
message: 'You don\'t have access to licensing data for App ID: aaaaaaaaaaaaaaaaaaaaaaaaaaaa'
}
}
如何在我的服务器中访问我的应用程序的许可证数据?
迈克
代码如下:
var appId = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
var userId = '1111111111111111111111';
// obtain a JWT-enabled version of request
var request = require('google-oauth-jwt').requestWithJWT();
request({
url: 'https://www.googleapis.com/chromewebstore/v1.1/licenses/'+appId+'/'+userId,
jwt: {
// use the email address of the service account, as seen in the API console
email: '11111111111-aaaaaaaaaaaaaaaaaaaaaaaa@developer.gserviceaccount.com',
// use the PEM file we generated from the downloaded key
keyFile: 'config/keys/app-11111111111111.pem',
// specify the scopes you wish to access - each application has different scopes
scopes: ['https://www.googleapis.com/auth/chromewebstore.readonly']
}
}, function (err, res, body) {
console.log(JSON.parse(body));
});
最佳答案
我花了很多时间来解决 Chrome 网上应用店的这个问题和其他小问题。使用 Stripe.com、Braintree 或类似网站。
关于node.js - Chrome Web Store 'You don' 无法访问 App ID :' 的许可数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26488950/