(AGK version: 108.19)
Submitted: 2013-10-19 09:43:47
#constant true 1
#constant false 0

global iap_onoff as integer = false
global iapVies as integer = -1
global iapBombes as integer = -1
global iapMelanges as integer = -1
if (left(getDeviceName(),3) = "ios")
	iap_onoff = true
	// title of windows
	inAppPurchaseSetTitle(getAppName())
	// set up first inApp Product (id "bidioojoker" already created on iTunes Connect)
	iapVies = 0
	inAppPurchaseAddProductID("bidioojoker",1)
	// set up first inApp Product (id "bidioobombes" already created on iTunes Connect)
	iapBombes = 1
	inAppPurchaseAddProductID("bidioobombes",1)
	// set up first inApp Product (id "bidioomelanges" already created on iTunes Connect)
	iapMelanges = 2
	inAppPurchaseAddProductID("bidioomelanges",1)
	// activate inApp for AGK
	inAppPurchaseSetup()
endif

// ...

// somewhere in the program, to by product bidioojoker => iapVies
if (iap_onoff = true)
	// inApp available on this device
	txt = createText("clic to buy bidioojoker")
	sortie = false
	repeat
		sync()
		if (getPointerPressed() = 1)
			inAppPurchaseActivate(iapVies)
			while (getInAppPurchaseState() = 0)
				sync()
			endwhile
			if (getInAppPurchaseAvailable(iapVies) = 1)
				// product bought by the player, add your code there
			else
				// product not bought by the user
			endif
		endif
	until (sortie = true)
	deleteText(txt)
else
	// inApp not available
endif
Help make AGK better by submitting an example for this command!
(All examples are subject to approval)
Login to post an example of your own.