store.consumePurchase()

Type Function
Return value none
Revision 2017.3060
Keywords Google, IAP, in-app purchases, consumePurchase
See also store.purchase()

Overview

This function "consumes" purchases and makes the item(s) available for purchase again. In Google IAP, once a product is purchased, it is considered "owned" and it cannot be purchased again. Thus, you must use this function to revert "owned" products to "unowned" products so they become available for purchase again.

Note that some items are designed to be purchased only once and you should not consume them. For example, if a purchase unlocks a new world within a game, it should be ineligible for future consumption. Alternatively, some items can be purchased multiple times, for example energy packs and gems — these type of items must be consumed before they can be purchased again. For further information, please see Google's documentation.

Gotchas

Syntax

store.consumePurchase( productIdentifier )
productIdentifier (required)

String. String representing the product identifier of the item to consume.