Node.js Chrome网络商店';你没有';无法访问应用程序ID'的许可数据;
我有一个离线Chrome网络应用,我想通过网络商店销售 它有一个服务器后端。我希望服务器检查许可证数据。我该怎么做 这是我的建议。这是一个例子。这是一个例子。我创建了一个新的客户端id,如lib的自述文件中所述 我得到的答复是:Node.js Chrome网络商店';你没有';无法访问应用程序ID'的许可数据;,node.js,google-api,google-chrome-app,chrome-web-store,Node.js,Google Api,Google Chrome App,Chrome Web Store,我有一个离线Chrome网络应用,我想通过网络商店销售 它有一个服务器后端。我希望服务器检查许可证数据。我该怎么做 这是我的建议。这是一个例子。这是一个例子。我创建了一个新的客户端id,如lib的自述文件中所述 我得到的答复是: { error: { errors: [ [Object] ], code: 403, message: 'You don\'t have access to licensing data for App ID: aaaaaaaaaaaaaa
{ 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));
});
我花了很多时间在ChromeWebStore的这个和其他小问题上。使用Stripe.com、Braintree或类似网站