是否可以使用服务帐户流访问Google Play Developer API?此处的文档(https://developers.google.com/android-publisher/authorization)仅提及OAuth 2.0 Web服务器流程.但目前还不清楚它是示例还是限制.
如果可能的话,提供一些工作示例链接会很棒.因为我无法通过"此开发者帐户不拥有应用程序"响应.
我在我的移动应用中实现了应用内计费。它使用自动续订订阅。我想通过应用程序检查订阅到期日期。我找到了这个链接来检查订阅详情:Purchase.subscriptions:get
文档显示需要一些授权。我试过了,但我无法得到结果。我得到了客户端 secret.json 文件,但它不包含客户端机密 ID。所以请帮助我获取订阅到期日期。
我正在为我的安全后端服务器将 AndroidPublisher 库从 v1 升级到 v3。AndroidPublisher 库 (v3) 将允许我安全地对应用内购买和订阅进行服务器端购买验证和确认。
v1 的现有代码不再兼容。v3 库看起来更好,但我找不到任何示例代码:
Get&Acknowledge使用 PurchaseToken 购买。Maven 设置:
<project>
<dependencies>
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-androidpublisher</artifactId>
<version>v3-rev103-1.25.0</version>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.30.2</version>
</dependency>
</dependencies>
</project>
Run Code Online (Sandbox Code Playgroud)
API 文档:https : //developers.google.com/android-publisher/api-ref/purchases/products/get
寻找这样的示例:https : //developers.google.com/api-client-library/java/google-api-java-client/samples
任何简短的示例代码都会有很大帮助。