iOS requires that developers provide a way to restore in-app purchases, and GameMaker: Studio provides a handy function to do just that: iap_restore_all();
The only problem is, I don't have a clue how it works.
The official documentation says it adds a key to the iap_data ds map which returns whether or not restoration was successful. But there is nothing in the official docs, or on the helpdesk, that explains how you can then use that information to check whether a specific item has been purchased and act accordingly.
For example, I have an IAP I want to add to my game called "removeAds". When the IAP has been purchased it sets the variable global.ads to 0, and no adverts will be shown in the game.
How do I go from calling iap_restore_all to something like this:
The only problem is, I don't have a clue how it works.
The official documentation says it adds a key to the iap_data ds map which returns whether or not restoration was successful. But there is nothing in the official docs, or on the helpdesk, that explains how you can then use that information to check whether a specific item has been purchased and act accordingly.
For example, I have an IAP I want to add to my game called "removeAds". When the IAP has been purchased it sets the variable global.ads to 0, and no adverts will be shown in the game.
How do I go from calling iap_restore_all to something like this:
Code:
if ( removeAds was previously purchased ) {
global.ads = 0;
} else {
global.ads = 1;
}