有没有办法测试 google 应用内结算的订阅项目,而无需在 google 游戏控制台中激活它们的状态?

Is there anyway to test subscription items of google in-app billing without making their state active in google play console?

我在测试我的应用程序中的订阅项时遇到问题。关于我阅读的应用内计费文档和堆栈溢出帖子, 据我所知,为了在应用内结算中测试订阅项目,我们有两个选择:

  1. 单人测试(订阅项目不可能)。所以这个项目对我们来说是不可能的。

    Google 文档: Note: Static responses cannot be used to test subscriptions.

  2. 尝试购买的产品 ID 应该在 Google 游戏机中有效。由于生产用户会看到这些项目,因此我们无法激活它们,因此我们需要找到另一种方法。

    Google 文档:To be available for purchase, a product needs to be active, and its app needs to be published.

问题:

  1. 有没有什么方法可以在不激活 Google 游戏机的情况下测试订阅项目?
  2. 有没有类似苹果内购或者亚马逊内购的沙盒模式?

如果订阅项目在 Play 控制台中 'active',除非您的应用专门查询 sku(在 Play 控制台中设置的产品 ID),否则用户将无法看到它。

例如,在官方play billing sample app, we store all the skus that are defined in the play console and only query中,对于我们在应用程序代码中定义的SKU。这意味着我们可以在 Play 控制台中添加额外的应用内产品,而生产用户不会看到它,只要查询产品的代码也没有交付到生产环境。