Migrating from StoreKit
Map StoreKit types and patterns to their OnsideKit equivalents.
OnsideKit is modeled on StoreKit's original (SKPaymentQueue-based) API, so most concepts map directly. This page lists the equivalents and the differences worth knowing.
Type mapping
SKPaymentQueue.default()
Onside.defaultPaymentQueue()
SKPayment
OnsidePayment
SKPaymentTransaction
OnsidePaymentTransaction
SKPaymentTransactionState
OnsidePaymentTransactionState
SKPaymentTransactionObserver
OnsidePaymentTransactionObserver
SKProductsRequest
OnsideProductsRequest (via Onside.makeProductsRequest(productIdentifiers:))
SKProductsRequestDelegate
OnsideProductsRequestDelegate
SKProduct
OnsideProduct
SKProductSubscriptionPeriod
OnsidePeriod
finishTransaction(_:)
finishTransaction(_:)
restoreCompletedTransactions()
restoreCompletedTransactions(completion:)
Key differences
Queue accessor. Use
Onside.defaultPaymentQueue()— notSKPaymentQueue.default(), and notOnside.paymentQueue().Completion arguments are required.
add(_:completion:)andrestoreCompletedTransactions(completion:)take a non-defaultedcompletion(pass a closure ornil). The completion reports only the pre-flight outcome (e.g..loginDiscarded); transaction updates still arrive via the observer.Login is built in. OnsideKit presents login on demand when a purchase/restore needs it — there's no separate StoreKit-style account check. See Authentication & User Account.
Product identifiers are Onside slugs.
OnsideProduct.productIdentifieris the identifier you configure in the Onside console and request with — not an App Store SKU.appAccountTokenvia mutation.OnsidePayment's only initializer isinit(product:); setappAccountTokenby mutating the value (var payment = OnsidePayment(product:); payment.appAccountToken = ...).Resilient enums. OnsideKit enums are non-frozen; include
@unknown defaultinswitchstatements. See Threading & Object Lifetime.Storefront safety gate. When the storefront/price changes for a queued purchase, OnsideKit asks your
OnsidePaymentQueueDelegatebefore continuing.
Last updated
Was this helpful?