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.

iOS and MacOS / how to user in app purchase for iOS with AGK

Author
Message
pprem
12
Years of Service
User Offline
Joined: 14th Jun 2012
Location: Paris, France
Posted: 19th Oct 2013 16:46
If you want to use inApp, you can inspire from this code :



I've submitted it as an example to the documentation page inAppPurchaseSetup

Have a great week-end

Patrick

--
Patrick P.
http://www.gamolf.fr
tornado
19
Years of Service
User Offline
Joined: 21st Jul 2005
Location:
Posted: 22nd Oct 2013 14:49
Great Patrick, thank you for the input! That was the piece of code I was starving for when I published my first iOS app
I'm, well, a bit concerned if this part can work asynchronously:

If a network or server is down, getInAppPurchaseState() will always return false, shouldn't it? This makes an endless cycle then

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 22nd Oct 2013 16:27
It is generally a good idea to have a timeout value that is also checked.

Something like:

// set up to time out after 60 seconds
timeout# = Timer() + 60.0

// do first check
purchstat = getInAppPurchaseState()

// check until either we get a value or time out
while ((purchstat = 0) && (Timer() < timeout#)
// check state again
purchstat = getInAppPurchaseState()
sync()
endwhile

// check for time out
if purchstat = 0
// do some sort of timeout processing
endif

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-11-21 14:07:35
Your offset time is: 2024-11-21 14:07:35