[Question - Solved] Google Play - Consumable vs. Non-Consumable Products

I am a bit confused on Consumable vs. Non-Consumable products on Google Play and was hoping someone could help out with an answer.

My Codeless IAP is working flawlessly with iOS, including Restore. iOS has consumable and non-consumable options, so it works as expected.

With Google Play, there isn’t an option for consumable and non-consumable, and according to : https://developer.android.com/google/play/billing/api#consumetypes

  1. If the purchase was successful, consume the purchase by calling the consumePurchase method

I don’t see any “consumePurchase” in the IAP example, unless I am just missing it.

So if the player installs my game on a 2nd device, how do we know to restore a non-consumable (remove ads) and to NOT restore a consumable (coins)?

I’m so sorry! It’s been a while since I set up my products in the Unity IAP window in the editor and just noticed that there is a dropdown for Consumable and Non-Consumable. It must be taken are of for us.

You can delete this post if that is the case.

Sorry again!

1 Like

Hello @breban1

Let me try explain the difference between Consumable vs Non-Consumable and what is the ConsumePurchase option for CodelessIAP

Consumable vs Non-Consumable

So a consumable is something that is consumed. Consumed means something that keep an inventory of in your game to allow the player to access to unlock things. A great example of this would be the idea of coins or gems a player can buy. The app would consume the purchase and add the amount of coins or gems to the players “wallet”.

A non-consumable is something that is not consumed and kept in the history of the players purchase forever. Similar to a subscription when a player has this purchase it unlocks features. A good example would be a purchase to remove ads from a game. This is a one time purchase the player can do and will sync on all his devices automagically because it is linked to the account he purchased with.

The ConsumePurchase Feature of Codeless IAP

This is a custom Unity feature, it is not store specific, so I can understand your confusion.

The ConsumePurchase checkbox is available on all IAPButton and on the IAPListener. To understand this feature it’s crucial to understand the ProcessPurchase feature.

The ProcessPurchase method is called on every new purchase and when the player launches the app. This method can be found in the CodelessIAPStoreListener or any class implementing IStoreListener. It is used to let Unity know if Unity can finish the transaction and consume the purchase, allowing you to do your validation or book keeping for your app.

Going back to the ConsumePurchase checkbox, when checked the CodelessIAPStoreListener will automatically return PurchaseProcessingResult.Complete meaning the purchase can be finished on the Unity side. When the ConsumePurchase checkbox is unchecked the CodelessIAPStoreListener will automatically return PurchaseProcessingResult.Pending allowing you the time to finish up with the purchase. When you are done with the purchase you simply have to call the class implementing IStoreController.ConfirmPendingPurchase(product) to allow Unity to finish and consume the product for you on the store.

This is a simplified way of seeing it. There is a bit more dept here, but it gives you a general idea of what is happening.

1 Like

Thank you so much for the explanation!