I'm trying to implement an InAppBilling in my Android app.
I'm almost there, but there is still one part missing.
I've followed the documentation (http://developer.android.com/google/play/billing/billing_integrate.html#Subs) and replicate the logic used in the sample app provided by Google.
I have this application published in alpha mode, with one test account and an integrated product (subscription) created.
String payload = "";
mHelper.launchPurchaseFlow(Settings.this, SKU_PREMIUM, IabHelper.ITEM_TYPE_SUBS,null, 1000, mPurchaseFinishedListener, payload);
If SKU_PREMIUM
variable is the real product id defined in google console, everything is fine. I windows appears in my application telling me to buy the subscription, and its price. However, given that I do not have a visa card associated to my test account, I cannot proceed. Thus, I'm trying to use Static Responses.
However, if I change SKU_PREMIUM
to "android.test.purchased"
, I'm given an error saying The item you requested is not available for purchase.
.
And even if I change reserved code to android.test.canceled
, android.test.refuned
or android.test.item_unavailable
the outcome is the same.
What am I missing here? Thanks!
The problem is that you cannot use reserved product ids on subscription testing. They are only suitable for "normal" purchases. For subscriptions you to use the right subscription id defined by you in google play settings page. You should:
If you have this setup, you won't be charged by Google. Note that in-app subscriptions auto-renew every 24h.
As far as I know, there is no easy way to test the android in-app billing. You really have to follow theses steps.