Search code examples
androidin-app-purchasein-app-billing

How to make purchasing one in-app product several times possible?


I'm trying to implement in-app billing system in my app to serve ads free version to users. I learned these steps and finally I succeeded to buy my product by using my test account. (I got the OK resposeCode through onPurchasesUpdated() method.)

However I could not buy it again. There was no response after calling launchBillingFlow(). I don't know why. Even if my product is ads free version (I mean permanent item.), I want to know that buying one item several times. Please let me know.


Solution

  • Once a managed product is purchased, it is considered to be "owned". Managed products in the "owned" state cannot be purchased from Google Play. You must send a consumption request for the "owned" managed product before Google Play makes it available for purchase again. Consuming the managed product reverts it to the "unowned" state, and discards the previous purchase data

    As soon as the User buys a product from your application, just consume it and keep track of the purchase some other way. By storing the credits on your server may be.

    More on the developer site