当我在Google Developers Console中使用Google Play Android Developer API测试购买产品的状态时,会发生这种情况,结果总是如此
{
"error": {
"errors": [
{
"domain": "androidpublisher",
"reason": "projectNotLinked",
"message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console."
}
],
"code": 403,
"message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console."
}
}
使用其他开发者帐户(和包名称)检查了这一点,它工作得很好。我确定已将Google开发者控制台的API项目与Google Play开发者控制台 - > API访问设置相关联,并尝试尽可能多地重新创建,但没有任何项目有效。
那我在这里错过了什么?除了我在Google Play控制台设置中制作的链接项目外,它的含义是什么“无法链接”。
几天后,我尝试使用API Explorer来使用Android Publisher API但失败了,我请求Google支持并收到答案“看起来发布API不再支持API Explorer”。所以基本上我不能再使用API Explorer来检查应用内购买令牌。
希望这有助于谁在努力解决这个问题。
几天后,我尝试使用API Explorer来使用Android Publisher API但失败了,我请求Google支持并收到答案“看起来发布API不再支持API Explorer”。所以基本上我不能再使用API Explorer来检查应用内购买令牌。
希望这有助于谁在努力解决这个问题。
我也得到了这个,只是放弃了让它工作,而是切换回API的v1.1:
final URL url = new URL(
"https://www.googleapis.com/androidpublisher" +
"/v1.1/applications/" + "com.example.app.id" +
"/subscriptions/" + subcriptionId +
"/purchases/" + googlePurchaseReceipt +
"?access_token=" + googleAccessToken);
希望有人会在某个时候发布更好的答案,我们都可以切换到API的v2。
您需要在Google中链接项目 玩 设置 - > Api访问下的开发者控制台。
在这里看到我的完整答案: https://stackoverflow.com/a/25825907/1745234
如果其他人遇到相同问题,请尝试在您的Google Play控制台帐户中添加新产品/订阅。这对我有用,虽然似乎是Google服务中的某种不一致问题。
使用“SERVICE ACCOUNT”进行身份验证时,我收到了相同的错误消息。但是当使用“已安装的应用程序”类型的OAuth客户端时,一切正常。修理:
- 转到Google Play开发者控制台上的API访问页面。
- 单击“创建oAuth客户端”按钮。
- 确保选择“已安装的应用程序”
- 使用生成的客户端ID和密码来获取访问/刷新令牌,如中所述 https://developers.google.com/android-publisher/authorization
- 使用访问令牌发出api请求。