if event.transaction.state == StoreKit.FAILED then AlertDialog.new("Error occured", event.errorDescription, "Ok"):show() else if event.transaction.state == StoreKit.PURCHASED then --unlock content here coins=coins+50 coinst:setText(coins) print("!") dataSaver.saveValue("coins",coins) AlertDialog.new("Purchase Completed", "Purchase successfully completed", "Ok"):show() end if event.transaction.state == StoreKit.RESTORED then --restore purchase here end -- or you can do it here if purchase and restore is the same for you end storekit:finishTransaction(event.transaction) end
Comments
http://www.nightspade.com
if event.transaction.state == StoreKit.FAILED then
AlertDialog.new("Error occured", event.errorDescription, "Ok"):show()
else
if event.transaction.state == StoreKit.PURCHASED then
--unlock content here
coins=coins+50
coinst:setText(coins)
print("!")
dataSaver.saveValue("coins",coins)
AlertDialog.new("Purchase Completed", "Purchase successfully completed", "Ok"):show()
end
if event.transaction.state == StoreKit.RESTORED then
--restore purchase here
end
-- or you can do it here if purchase and restore is the same for you
end
storekit:finishTransaction(event.transaction)
end