For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

StoreKit
OnsideKit

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() — not SKPaymentQueue.default(), and not Onside.paymentQueue().

  • Completion arguments are required. add(_:completion:) and restoreCompletedTransactions(completion:) take a non-defaulted completion (pass a closure or nil). 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.productIdentifier is the identifier you configure in the Onside console and request with — not an App Store SKU.

  • appAccountToken via mutation. OnsidePayment's only initializer is init(product:); set appAccountToken by mutating the value (var payment = OnsidePayment(product:); payment.appAccountToken = ...).

  • Resilient enums. OnsideKit enums are non-frozen; include @unknown default in switch statements. See Threading & Object Lifetime.

  • Storefront safety gate. When the storefront/price changes for a queued purchase, OnsideKit asks your OnsidePaymentQueueDelegate before continuing.

Last updated

Was this helpful?