iap_consume

Clears the purchase status of unmanaged purchases.

Syntax:

iap_consume(purchase_id);


Argument Description
purchase_id The product ID string for the purchase.


Returns: N/A


Description

This function can be used for clearing the purchase status of any unmanaged (consumable) purchases. The "purchase_id" is the product ID string which you specified when activating the IAP using iap_activate, and should be the same as that which you used to identify the product on the target store. This function will trigger an IAP Event of the "type" iap_ev_consume, which will contain the following additional keys:

This product ID can then be used to check which purchase has triggered the event, and you can deal with it accordingly.

WARNING: You cannot purchase a consumable product multiple times in a row without consumption - you must perform a consume operation between subsequent purchases.


Example:

if mouse_check_button_pressed(mb_left)
   {
   iap_consume("noads")
   }

The above code will clear the purchase status when the mouse button is pressed.


Back: In App Purchases
Next: iap_product_details
© Copyright YoYo Games Ltd. 2019 All Rights Reserved