简体   繁体   中英

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.

To test the app I have done the following:

  • Uploaded a draft binary to Google Play but not published it.

  • Created and published the Subscription product in the developer console.

  • Added my Google account to the list of test accounts in the developer console

  • Exported my APK from eclipse (with the same package name and version name/code as the one uploaded to Google Play)

  • Installed this exported APK on my test device which is logged in with the test account.

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. 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.

Note: Test subscription purchases recur daily, regardless of the product's subscription period.

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

But I don't know when Google made the update to this documentation.

As they has said, you can do it following de goolge documentation:

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. 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 . Para obtener más información, consulta Configuración para compras de prueba. Blockquote

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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