Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
in-app-purchase example - Page 2 — Gideros Forum

in-app-purchase example

2»

Comments

  • NascodeNascode Guru
    edited August 2013
    @unlying could you share your iap handling code?
    have fun with our games~
    http://www.nightspade.com
  • unlyingunlying Guru
    edited August 2013
    local function onTransaction(event)

    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
Sign In or Register to comment.