GameMaker How to use iap_restore_all() ?

@Jizo

Member
Hey everyone,

I'm about to port my Android game on iOS.
It have IAP's made with Easy IAP Marketplace extension.
IAP's seems to work properly on iOS too while testing on a sandbox mode.

I don't understand the IAP stuff very well so when a player taps the restore button, it executes the short code in step event: iap_restore_all();
This doesn't seem to restore the bought IAP's just like that. Even the xCode says "Transaction restored" upon tapping, nothing actually gets restored. Or maybe iap_restore_all() doesn't work while testing on a sandbox mode?

What's the proper way to use iap_restore_all() function?

I've read the manual and 100% fully checked the web but I didn't find a proper tutorial that tells how to use iap_restore_all().

Thank you so much for the help! This is the last thing preventing me to upload my first iOS app.

Using newest version of GMS2.
 
D

DifferentName

Guest
After the button triggers iap_restore_all(), you'll get a response in an IAP async event, like you do for purchases. So just make sure you include iap_ev_restore in your async event, along with purchasing:
if(val==iap_ev_purchase || val==iap_ev_restore){
 

@Jizo

Member
After the button triggers iap_restore_all(), you'll get a response in an IAP async event, like you do for purchases. So just make sure you include iap_ev_restore in your async event, along with purchasing:
if(val==iap_ev_purchase || val==iap_ev_restore){
Thank you so much sir! Seems that I finally got it working!
 
P

Panagis Alisandratos

Guest
How can you check which specific purchases have been restored if iap_data only includes "type" and "result" keys?

UPDATE: It appears a successful restore will trigger an IAP Event of type iap_ev_purchase where you can confirm the purchase. It should be safe to assume the even will be triggered for every purchase.
 
Last edited by a moderator:
Top