简体   繁体   English

测试Android IAP /应用程序内购买订阅

[英]Testing Android IAP/In-App Purchase Subscriptions

I am implementing several Android applications to be launched on Google Play and they all have subscriptions using the Google IAP auto-renewing subscription product type. 我正在实施几个Android应用程序,这些应用程序将在Google Play上推出,并且他们都使用Google IAP自动续订订阅产品类型进行订阅。

To test the app I have done the following: 要测试应用程序,我已完成以下操作:

  • Uploaded a draft binary to Google Play but not published it. 已将草稿二进制文件上载到Google Play但未发布。

  • Created and published the Subscription product in the developer console. 在开发人员控制台中创建并发布了Subscription产品。

  • Added my Google account to the list of test accounts in the developer console 将我的Google帐户添加到开发者控制台中的测试帐户列表中

  • Exported my APK from eclipse (with the same package name and version name/code as the one uploaded to Google Play) 从eclipse导出我的APK(与上传到Google Play的包名和版本名称/代码相同)

  • Installed this exported APK on my test device which is logged in with the test account. 在我的测试设备上安装了此导出的APK,该设备已使用测试帐户登录。

I am now able to successfully test my purchase and every thing works. 我现在能够成功测试我的购买,每件事都有效。 However, as far as I can see, this purchase is real and the subscription is actually valid for an entire month. 但是,据我所知,这次购买是真实的,订阅实际上是整整一个月都有效。

Is there no way to do any kind of "sandbox" testing or at least a way to prematurely cancel this subscription? 有没有办法进行任何类型的“沙盒”测试,或者至少是一种过早取消此订阅的方法?

How can I test the scenario where my subscription has expired without having to wait a month?! 如何在不必等待一个月的情况下测试我的订阅已过期的场景?!

Any help is much appreciated! 任何帮助深表感谢!

Not for subscriptions. 不适用于订阅。 The new (v3) in-app billing API has been released, but it currently does not support subscriptions. 新的(v3)应用内结算API已发布,但目前不支持订阅。 When it does, it might bring an easier way to test (seems unlikely though). 如果确实如此,它可能会带来更简单的测试方法(尽管看起来不太可能)。 You just have to cancel subscriptions/purchases in the merchant console when you are done testing. 完成测试后,您只需在商家控制台中取消订阅/购买。

Google has finally added a way to test subscriptions. 谷歌终于添加了一种测试订阅的方法。 Their documentation now says: 他们的文件现在说:

Test purchases, which let your selected license-test users purchase your in-app products without any resulting charges to the user. 测试购买,让您选择的许可测试用户购买您的应用内商品,而不会给用户带来任何费用。 Test purchases can be used in alpha/beta releases or in published apps. 测试购买可用于alpha / beta版本或已发布的应用程序。

Note: Test subscription purchases recur daily, regardless of the product's subscription period. 注意:无论产品的订购期限如何,每天都会重复测试订阅购买。

http://developer.android.com/google/play/billing/billing_testing.html http://developer.android.com/google/play/billing/billing_testing.html

But I don't know when Google made the update to this documentation. 但我不知道Google何时对此文档进行了更新。

As they has said, you can do it following de goolge documentation: 正如他们所说,你可以在de goolge文档之后做到:

http://developer.android.com/google/play/billing/billing_testing.html http://developer.android.com/google/play/billing/billing_testing.html

The only thing you need is to add an acount for test: 您唯一需要的是添加一个帐户进行测试:

Luego crea cuentas de prueba de licencias para los usuarios autorizados. Luego crea cuentas de prueba de licencias para los usuarios autorizados。 En la Developer Console, ve a Settings > Account details y luego, en la sección License Testing , agrega las direcciones en el campo Gmail accounts with testing access . En la Developer Console, 设置>帐户详细信息 y luego,enlasección 许可证测试 ,agrega las direcciones en el campo 具有测试访问权限的Gmail帐户 Para obtener más información, consulta Configuración para compras de prueba. Paraobtenermásinformación,consultaConfiguraciónparacompras de prueba。 Blockquote 大段引用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM