Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / InAppPurchaseRestore() help

Author
Message
Lavaflyer
11
Years of Service
User Offline
Joined: 2nd Jul 2012
Location: Wisconsin, U.S.
Posted: 24th Dec 2013 07:04 Edited at: 24th Dec 2013 07:08
How exactly do I use InAppPurchaseRestore(). I want to call it after the user presses a button titled "Restore Purchases", then if it finds the user has previously bought either of my iap's I want it to save this off.

This is the code I am using to do this but the but the problem is getinapppurchasestate() does not work with the restore command and there is no way to tell if the attempted restore has finished. any suggestions?


nRainbowBundlePurchased and nMetalBundlePurchased are the booleans that are later saved to a file in SaveIap() designating the user has purchased this iap and should recieve the additional content.
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 24th Dec 2013 07:18 Edited at: 24th Dec 2013 07:19
Throw a loop after calling InAppPurchaseRestore() until GetInAppPurchaseState() is not equal to 0 [it will equal 1 when complete], then recheck IAP. Below is boilerplate from a past app I've developed, assuming one non-consumable IAP is at id 0.

Login to post a reply

Server time is: 2024-05-02 00:41:42
Your offset time is: 2024-05-02 00:41:42