ios - StoreKit - restoring multiple non-consumable IAPs -


using tutorial guide, i'm implementing in-app purchases ios app. restore purchases, tutorial uses piece of code:

    // mark: - restore non-consumable purchase button @ibaction func restorepurchasebutt(_ sender: any) {     skpaymentqueue.default().add(self)     skpaymentqueue.default().restorecompletedtransactions() }  func paymentqueuerestorecompletedtransactionsfinished(_ queue: skpaymentqueue) {     nonconsumablepurchasemade = true     userdefaults.standard.set(nonconsumablepurchasemade, forkey: "nonconsumablepurchasemade")      uialertview(title: "iap tutorial",     message: "you've restored purchase!",     delegate: nil, cancelbuttontitle: "ok").show() } 

on paymentqueuerestorecompletedtransactionsfinished function non-consumable purchase set bought, , alert shown. however, don't quite understand how function called, seems set iap set bought if hasn't been bought before. checks first if purchase made, if have multiple non-consumable purchases in app? if of items have been purchased?

what correct way restore purchases when multiple non-consumables available purchase?


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -