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

Testing Purchases

Test product loading, login, purchases, and restores with local simulation and a service-backed OnsideKit integration.

Use a bundled .storekit file to exercise the purchase lifecycle during development, then verify authentication and payment processing with your service-backed integration.

Local purchase simulation

Pass the configuration file’s base name to initialization:

Onside.initialize(storeKitConfigurationName: "LocalProducts")

Products, purchases, and restores use the local simulation. For offline login, leave external login disabled and return .local from OnsideDelegate.onsideLoginMethod().

The simulation uses the same payment queue, transaction states, and observer callbacks. Check product loading, cancellation, transaction finishing, restores, and your handling of storefront changes.

See Local Testing with a .storekit File for setup, supported fields, resetting purchase history, and unavailable APIs.

External-account purchases

Use an iOS build connected to the service to verify external login. A .storekit file does not reproduce a real external profile or its purchase restrictions.

Check the following flows:

  • A missing external identifier falls back to the selected .auto or .local login route.

  • After external login, subscriptions and non-consumables move to unsupportedProductIdentifiers.

  • Buying a previously loaded unsupported product fails with .notSupportedForExternalLogin before enqueueing.

  • A consumable purchase without Apple Pay fails with .applePayRequired.

  • The payment methods manager fails with .notSupportedForExternalLogin.

  • A successful consumable purchase delivers transaction updates and presents the receipt reminder.

Also check your app’s account-switching behavior: changing or removing the external delegate does not replace an existing SDK session. Sign out before switching the SDK to another account.

Phone login and presentation

The phone-login UI recognizes sandbox phone numbers in the +999 range. Use credentials provided for your service environment; this is not an offline login bypass and does not define a universal verification code.

Test SDK screens from both portrait and landscape host views and, where applicable, while resizing the app’s window. Verify that the host window regains focus and the host’s supported orientations are restored after the SDK UI closes. See The Onside Delegate.

See also

Last updated

Was this helpful?