Question

I've implemented in-app billing to my app but I want to make it a little different. I want to create purchase for example: unlock this item for 2 months. When I want to end the purchased item license, I call my consumeItem(); method.

But where and how should I put this method, to be automatically consumed after 2 months after user has purchased it?

Was it helpful?

Solution

Using subscriptions may be a good idea. This way, user will definitely know that it is just a subscription and it can be immediately invalidated when the time comes.

Another good idea might be to use a server. You can store all the data about the purchases and information about the users. Then you can check the purchase status whenever you like using the beloew Purchase Status API https://developer.android.com/google/play/billing/gp-purchase-status-api.html#overview and then you can disable users purchase status if the purchase was 2 months old.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top