Android Question InAppBilling3 - Consume purchase

jpvniekerk

Active Member
Licensed User
Longtime User
I am trying to consume purchases by user choice. This should be outside of the billmanager_OwnedProducts sub. For this, I need to get the purchases from OwnedProducts and then use them (could be more than one) in the billmanager.ConsumeProduct(product).

I get the OwnerProducts at app start, but later want to consume one (or all) of them.

Any advice on how to accomplish this will be appreciated!
 

jpvniekerk

Active Member
Licensed User
Longtime User
Thanks Erel, got that part working.

But now after purchase was consumed and I try to buy it again, I get a message from google play that the item is not available for purchase.
The ownedProducts does not show this item anymore.
btw I am working on a beta release of the app on google play with closed testing.

Is there a way to clear the local cache of InAppBilling? I have a feeling that this might be the problem.
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
Thanks Erel, got that part working.

But now after purchase was consumed and I try to buy it again, I get a message from google play that the item is not available for purchase.
The ownedProducts does not show this item anymore.
btw I am working on a beta release of the app on google play with closed testing.

Is there a way to clear the local cache of InAppBilling? I have a feeling that this might be the problem.

What did you send in your ConsumeProduct call? Did you get a Success = True result in your ProductConsumed callback?

I've got working consumables code in one of my apps, but I don't have access to it right now. If you post your code I can compare it with mine later & maybe point you in the right direction.

I've never had to clear the local cache to get it working. Not even sure if you can...

- Colin.
 
Upvote 0

jpvniekerk

Active Member
Licensed User
Longtime User
Thanks!
Got it working...
I changed the version code for my next revision - per my standard procedure (start a new version after apk was uploaded to google play). Once I uploaded the new apk all worked as expected again.

Interesting discoveries and tips through my working with Google Play Beta testing:
You can do full debugging on your device and everything works fine AS LONG AS THE VERSION IN GOOGLE PLAY AND YOUR DEVICE IS THE SAME. You can test changes with a local install and google play comms will work the same.
Once you're happy, THEN change the VersionName and VersionCode before uploading to Google Play.

Also, an app can have both in-app purchases and subscriptions active. I wrongly thought that it could be either, not both. Fortunately, I was wrong and you can have both.

In-app purchases AND subscriptions can be tested without charges IF THE TESTER'S GOOGLE ACCOUNT EMAIL IS SET UP IN Console > Account Details > License Testing AND in the Beta Test Group in Console > Manage Testers.
 
Upvote 0
Top