• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML IAP Restore Purchased

D

Dxnxex

Guest
Hello,

I will describe my problem in example.

"mr.Example1" will buy in my app "noAds". If you don´t quit app Ads will be not shown, but if you restart app Ads are shown again, so how to get back information "noAds" was already purchased.

same problem for consumables if bought 3 times "GoldPackage" what add 100 Gold by package.

so how to get back information he have 300 Gold and "NoAds", even after full uinstall and install app again ?

P.S. I tried ini and json files, but after reinstall app, there was no gold and Ads was activated.

Thank you for help
 

NightFrost

Member
Shouldn't information like this be stored on a remote central server? A program should never trust local information. Consider this: person A gets a "no Ads" from the shop. Then he rummages through his files or json/ini contents to see what has changed. He then makes this information publicly available. Person B comes along, follows the instructions and gets a "no Ads" for free, because the program checks for this from local storage, without confirming person B has ever actually bought it. Anything that players should not be able to touch should be stored remotely: shop purchases, money/gold, possibly even save states.
 

rIKmAN

Member
There is a function to restore purchases iap_restore_all() but I suggest you have a read through the documentation for IAP Purchases.

You should not be storing that data in ini files, they are easily read, modified and hacked - you should be querying the App Store and saving the information using secure maps via ds_map_secure_load() and ds_map_secure_save() - docs for those are in the links I just gave.
 

kamiyasi

Member
People messing with the files to get free upgrades would be the least of your troubles. Imagine a scenerio like this. IOS/Andoid has a system update that changes the way your file read/write works. You easily fix it in an update but all local purchase records were wiped. Or, say people do something unexpected like delete their game and restore it from icloud wih no data files attached. There's too many variables not to handle purchases asynchronously.
 
D

Dxnxex

Guest
so ds_map_secure_save/load is that function to get back information after load ?
I think function iap_restore_all() works for Mac and iOS and I need Windows UWP and Android + Regular Windows

Thanks for help .

EDIT: Do I need own server to stock players data ?
 
Last edited by a moderator:

rIKmAN

Member
As far as I know the IAP Event works for all target stores, at least the manual entry suggest so.

Not sure about Desktop (none Windows Store) but using your own server for authentication would be one way yes.
I suggest you read through the relevant manual entries and do some Googling.

Helpful links found from a 5sec Google search:

http://www.yoyogames.com/blog/74
http://help.yoyogames.com/hc/en-us/articles/216755198-In-App-Purchases-Example
https://www.reddit.com/r/gamemaker/...ing_android_durable_purchases_on_new_install/
 
Last edited:
Top