Quick Start
A minimal, end-to-end OnsideKit integration you can copy-paste: initialize the SDK, fetch a product, buy it, and finish the transaction.
1. Initialize the SDK and handle URLs
import UIKit
import OnsideKit
@main
final class AppDelegate: UIResponder, UIApplicationDelegate {
// Keep a strong reference to your purchase manager for the app's lifetime.
let store = PurchaseManager()
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
// 1. Initialize OnsideKit before calling any other OnsideKit API.
Onside.initialize()
// 2. Provide the callback URL scheme you declared in Info.plist.
Onside.callbackScheme = "com.yourapp.onside"
// 3. Register a transaction observer as early as possible. The payment
// queue stays idle until at least one observer is registered.
Onside.defaultPaymentQueue().add(observer: store)
return true
}
// 4. Forward incoming URLs so the app-to-app login flow can finish.
func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey: Any] = [:]
) -> Bool {
Onside.handle(url: url)
}
}2. Create a purchase manager
3. Run the flow
Next steps
Last updated
Was this helpful?