首页 > 解决方案 > Google Play Product Id

问题描述

[Edited as suggested by @Nick. Also made clearer the problem I am having. Also done a further edit to explain further.]

In my app on the Google Play Dashboard I have created an in app purchase called test1. So what is the product id I put in the following?

String productString = "test1";
bp.purchase(this, /* "YOUR PRODUCT ID FROM GOOGLE PLAY CONSOLE HERE" */ productString);

The purchase function is from Android In-App Billing v3 Library as noted by @Nick .

The error I am getting when I just have productString = "test1"; is it is saying:

Error
The item you requested is not available for purchase

When I do: bp.purchase(this, "com.mywebsite.jon.myappname.test1"); to make it look as much as possible like the test purchase example

I get the error from Google Play:

Error
Error while retreiving information fro server. [DF-AA-20]

​ I am not sure if this is important:

  1. I am at the very early stage of testing in Internal Testing (not Alpha or Beta testing).
  2. My developer account and my purchaser accounts are different
  3. I have the purchaser account email in my testers group

标签: google-playin-app-purchase

解决方案


此处的文档中描述了产品 ID 。这是:

“产品 ID - 您的产品的唯一、人类可读的 ID。产品 ID 在 Google Play 结算库中也称为 SKU。”

如果您将应用内购买称为“test1”,那么它就是“test1”。

- - - - 编辑

使用 3rd 方库(这是您链接到的库)而不是 Google 库的一个问题(或一件好事)是您没有获得官方文档。谷歌已经制作了一些关于应用计费测试的好文档

我会完成该页面上的所有步骤,如果仍然无法正常工作,请说出您失败的步骤。我怀疑出了什么问题是您尚未将您的应用发布到 Play 商店。在购买真正的应用内产品之前(而不是像“android.test.purchased”这样的测试产品名称)必须发布应用。

如果您还不想向全世界发布您的应用程序,请不要担心。您可以使用内部测试轨道。除了您添加到其中的测试帐户外,任何人都看不到内部测试轨道发布。它不会影响您在新发布的应用程序排行榜等方面的排名。它专门用于测试购买或 Google Play 许可证验证等内容。


推荐阅读