i included "remove ads" option in app. bought in sandbox mode once, need reset testing. needs reset when try buy again won't restore free.
func paymentqueue(queue: skpaymentqueue!, updatedtransactions transactions: [anyobject]!) { println("add payment") transactions:anyobject in transactions { var trans = transactions as! skpaymenttransaction println(trans.error) switch trans.transactionstate{ case .purchased: println("buy, ok unlock iad here") println(p.productidentifier) let prodid = p.productidentifier string switch prodid { case "removeads": println("remove ads") removeads() break; default: println("iap not set up") } case .failed: println("buy error") queue.finishtransaction(trans) break; default: println("default") break; } } } func removeads(){ noadsbutton.alpha = 0.0 adsok = false adsokdefault.setbool(false, forkey: "adsok") println("remove ads") } i using storekit.
to test iap on , on during initial debugging, easiest way switch non-consumable iap consumable temporarily. can debug buying on , over. once have gotten rid of bugs can switch non-consumable. become harder test because need create new test user each time. there longer writeup on issue here:
Comments
Post a Comment