Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 816
Dean Wild Avatar asked Dec 13 '12 14:12

Dean Wild


1 Answers

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.

like image 56
Areeb Avatar answered Sep 22 '22 17:09

Areeb