Iab

From GiderosMobile
Revision as of 12:06, 7 March 2019 by Apollo14 (talk | contribs)
Code example:
local test = IAB.new("test")

test:addEventListener(Event.AVAILABLE, function(e)
	--provide setup stuff (framework specific)
	test:setUp("value1", "value2", "value3")
	test:purchase("product1") --purchase something
end)

test:addEventListener(Event.PURCHASE_COMPLETE, function(e)
	--unlock your purchase here
	print(e.productId, e.receiptId)
	test:confirm(e.productId)
end)

test:isAvailable()
test:restore()