I am implementing an in-app subscription in an Android app. In the developer console I have a subscription item with a 7 day free trial. While debugging, I purchased this subscription. A couple days later, before the 7 day trial is over, I cancelled the subscription from the Play Store | My Apps | Subscriptions. Many days later, long after the 7 day trial period, in my code when I get the owned subscriptions (with inAppBillingService.getPurchases()) it still says I own the subscription. Since I cancelled it during the trial, I am not billed for it, but also, I no longer own that subscription. As far as I can tell, this is a bug with Google's In-App Billing Service. Any one know how this bug can be reported to Google so it can be fixed? As it is right now, customers can purchase my subscription and then cancel it during the trial period. They then get to keep using the subscription because Google says they own it. This is a MAJOR BUG.
-
Are you refreshing the products owned by the user? You need to periodically query the user inventory to make sure they are updated and still valid. – Ricardo Oct 06 '14 at 22:08
-
First, lets be clear that I am only talking about the client side interface. I am not using the server side interface (and can not for reasons I won't go into). When you say "periodically query the user inventory" do you mean call getPurchasees(). I call that every time the program starts, and I have started the program dozens of times every day for weeks. If there is some other way to do what you are talking about, please be specific. – plevintampabay Oct 07 '14 at 01:36
-
I suggest you go through the [in-app billing tutorial](http://developer.android.com/google/play/billing/billing_integrate.html) and make the [sample app work](http://developer.android.com/training/in-app-billing/preparing-iab-app.html#GetSample) in your environment. After that, if you are still having problems, please post a more specific question with example code of what you tried to do. – Ricardo Oct 07 '14 at 07:50
-
Thank you for your comment Ricardo. The sample app DOES NOT do anything with subscriptions. Please re-read my post. I am calling getPurchases() in my app and it is returning to me info about every subscription purchased, even though they have been cancelled by the user and should be expired by now. This is not a code question. This is a bug in Google's API, or it has never been documented that getPurchases does not consider the fact that a subscription has been cancelled. If you haven't a clue, please just say so. – plevintampabay Oct 07 '14 at 14:14
-
I used the sample app for my implementation and I use subscriptions with a trial period in my app. Everything works fine. – Ricardo Oct 07 '14 at 16:15
-
And so to confirm with you, someone purchases your subscription. Right after that getPurchases() in your app says they own the subscription. Then they cancel the subscription. Then the trial expires. Does getPurchases() no longer say they own the subscription for you? If you don't know, that's a fair answer. – plevintampabay Oct 07 '14 at 20:05
2 Answers
I went ahead and tested this in my app. Using the sample app, I call the method launchSubscriptionPurchaseFlow()
from the IabHelper
class to start the subscription purchase. After the user confirms it, I get the purchase validated and handle the UI update on OnIabPurchaseFinishedListener
.
I also check every time on my activity's onCreate()
method if the user has the purchased items and subscriptions. This is done with the method queryInventoryAsync()
of the same class. In my case, after canceling the subscription and waiting a few hours after the 7 days trial period elapsed, the user no longer had the subscription. You can test this by checking in the Purchase
object if myPurchase.getPurchaseState() != 0
. Possible purchase state values are listed in the documentation.
Finally, note that the cancellation will not be propagated immediately so it might take more than 7 days for that to go through. And it will take at least 7 days regardless of when the user cancels it. According to the documentation:
When the user cancels a subscription, Google Play does not offer a refund for the current billing cycle. Instead, it allows the user to have access to the cancelled subscription until the end of the current billing cycle, at which time it terminates the subscription. For example, if a user purchases a monthly subscription and cancels it on the 15th day of the cycle, Google Play will consider the subscription valid until the end of the 30th day (or other day, depending on the month).
Hope that helps.

- 7,785
- 8
- 40
- 60
-
Wow, thank you for doing this. Right, I know about the quote you took from Google's documentation. I have no problem with that. I will look again at the sample app and try to reproduce your results. Again, thank you. – plevintampabay Oct 15 '14 at 12:32
Now that a month has passed, I have more info. Clearly what I was seeing in October IS A BUG in Google's code. With absolutely NO change to my code, everything works as it should in the code deployed from the play store. This was true for alpha, beta and production. It did not work as expected for code installed on the device from Eclipse - hence the Google BUG.

- 550
- 4
- 18