iap_product_details

Add details of a single product to a ds_map.

Syntax:

GML Code Example

iap_product_details(product_id, ds_map);


Argument Description
purchase_id The product ID string for the purchase.
ds_map The ds_map that will store the product information.


Returns: N/A


Description

With this function you can populate a previously created ds_map with a number of key/value pairs that describe the given purchase. The following data is returned within the map:

  • "id" - The product ID string.

  • "title" - The title of the product.

  • "description" - The description of the product.

  • "price" - The price of the product, where available (not all stores support this).

  • "type" - The type of product, which will be either "Consumable" or "Durable", where available (not all stores support this).

  • "verified" - Will be either true or false (ie: real numbers 0 or 1) depending on whether or not your game has received details of this product from the store and thus believes this product to be available for purchase.

NOTE: The ds_map used is not created by the function, meaning that you must create it previously and remove it again from memory when not in use using the appropriate function.


Example:

GML Code Example

var p_map = ds_map_create();
 iap_product_details(ds_map_find_value(iap_data, "index"), p_map);
 p_title = " + string(ds_map_find_value(p_map, "title")));
 p_description = " + string(ds_map_find_value(p_map, "description")));
 ds_map_destroy(p_map);
 

The above code will create a ds_map and then populate it with the product details for the product taken from the special iap_data ds_map which is created exclusively in the IAP Event. The "title" and "description" are then added to variables so that they can later be drawn on the screen.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here