iap_is_downloaded

Checks to see if the purchase has been downloaded.

Syntax:

GML Code Example

iap_is_downloaded(purchase_id);


Argument Description
purchase_id This can either be the Apple Store/Google Play id string, an URL id, or an index into the available purchases ds_list.


Returns: Boolean


Description

WARNING! This function has been deprecated.

This function can be used for checking to see if a purchase has been downloaded correctly (returns true) or not (returns false). The purchase_id can be either an integer index into the main purchases list, the explicit Apple Store/Google Play id string, or you can pass through the actual identifier name(eg: ".extralevels"), similar to the way that iap_acquire works. Please note that for consumables (ie: purchases that require no downloadable content) this function will always return true.


Extended Example:

We can use this function to check and see if the paid-for purchase has finished downloading or not. To start with we need to check the data returned from the function iap_event_queue which you would get from the asynchronous IAP Event. In the Create Event of the instance you would prepare a variable to store the returned value of this function and then in the IAP event itself have something like this:

GML Code Example

var q;
 q = iap_event_queue();
 if !ds_queue_empty(q))
    {
    downloaded = ds_queue_dequeue(q);
    }
 else
    {
    downloaded = 0;
    }
 

We can then use this value in other IAP functions, or simply check it to draw a status message for our user to see so they know that the download has been completed:

GML Code Example

if iap_is_downloaded(downloaded)
    {
    draw_text(x, y, "Files downloaded:");
    }
 

The above code will now use the iap_is_downloaded function to display a message to the user when the product they have bought has been downloaded correctly.





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