Error Reference
Every OnsideKit error type, its cases, what causes them, and how to handle them.
OnsideKit reports failures with small typed enums. Switch over the cases — they are not LocalizedError, so localizedDescription is generic.
Common causes
Many cases share a meaning across error types:
loginDiscarded
The user dismissed a required login screen.
cancelled
The operation was cancelled (by the user or stop()).
presentationFailed
OnsideKit couldn't present the purchase UI — no active window scene was available (e.g. the app was backgrounded). The purchase never started; retry once the app is in the foreground.
connectionError
Network failure — usually retryable.
serviceUnavailable
Server returned 5xx — retry later.
appNotRegistered
The app/install isn't recognized by Onside (HTTP 404) — check your app registration/configuration.
invalidProductIdentifier
The products request was rejected (HTTP 422).
internalError
Parsing or other unexpected error.
notLoggedIn
The operation requires an authenticated user.
rejectedAfterLogin
The payment queue delegate rejected the payment after login.
notSupportedForExternalLogin
The external profile cannot buy subscriptions/non-consumables or use the payment methods manager.
applePayRequired
A consumable purchase by an external profile requires Apple Pay, but it is unavailable.
notSupportedInLocalTesting
Unavailable while running with a .storekit configuration.
Errors by type
OnsideLoginError
loginDiscarded
OnsideProductsRequestError
cancelled, connectionError, appNotRegistered, invalidProductIdentifier, serviceUnavailable, internalError
OnsideSignedInAppsHistoryRequestError
notLoggedIn, notSupportedInLocalTesting, cancelled, connectionError, appNotRegistered, serviceUnavailable, internalError
OnsidePaymentMethodsManagerError
loginDiscarded, notSupportedInLocalTesting, notSupportedForExternalLogin, presentationFailed
OnsidePaymentQueueAddProductError
loginDiscarded, rejectedAfterLogin, notSupportedForExternalLogin, applePayRequired
OnsidePaymentQueueRequestRestoreError
loginDiscarded
OnsidePaymentTransactionError
cancelled, presentationFailed
OnsideTransactionsRestoreError
cancelled, connectionError, appNotRegistered, serviceUnavailable, internalError
OnsideAttributionMetadataError
connectionError, appNotRegistered, serviceUnavailable, internalError
Errors from OnsidePaymentQueue.add are pre-flight failures: the payment was not enqueued, so no transaction callback follows for that attempt. See Making a Purchase.
Where each is delivered
OnsideLoginError—Onside.requestLogin(completion:)OnsideProductsRequestError—OnsideProductsRequestDelegate.onsideProductsRequest(_:didFailWithError:)OnsideSignedInAppsHistoryRequestError—Onside.makeSignedInAppsHistoryRequest()result and its request delegateOnsidePaymentMethodsManagerError—Onside.presentPaymentMethodsManager(completion:)OnsidePaymentQueueAddProductError—OnsidePaymentQueue.add(_:completion:)OnsidePaymentQueueRequestRestoreError—OnsidePaymentQueue.restoreCompletedTransactions(completion:)(pre-flight)OnsidePaymentTransactionError—OnsidePaymentTransaction.erroron a.failedtransactionOnsideTransactionsRestoreError—onsidePaymentQueue(_:restoreCompletedTransactionsFailedWithError:)OnsideAttributionMetadataError—Onside.getAttributionMetadata(completion:)
Last updated
Was this helpful?