xee.ai/features/ios-app

Built for iOS, from the first line

One Swift package for purchases, access, paywall values and events. Xee checks every purchase with Apple on the server, so access is right on every device a user signs in on.

Why doesn't my sandbox purchase unlock premium?purchase-testing

Four steps

From package to first purchase

Each step is one page in the docs, in this order.

  1. Add the package and activate

    Add XeeSDK-iOS with Swift Package Manager and activate it once, as early in launch as you can.

    Install & configure
    App.swift
    import Xee
    
    Task {
        do {
            try await Xee.activate(withAPIKey: "xee_YOUR_SDK_KEY")
        } catch {
            // error is a XeeError: log it and keep the app usable
        }
    }
  2. Load a paywall and its values

    Ask for a paywall by its ID. You get its text, prices and products, or your own defaults when offline.

    Get a paywall
    PaywallView.swift
    let paywall = try await Xee.getPaywallVariant(paywallId: "main")
    // Read the values and products from `paywall`.
  3. Make a purchase

    One call opens the App Store sheet. Xee checks the purchase with Apple and turns on access.

    Make purchases
    Store.swift
    let result = try await Xee.makePurchase(product: product)
    switch result {
    case .userCancelled: break   // leave the paywall open
    default: dismiss()
    }
  4. Check access

    Xee has one access level, premium. A missing entry means no access.

    Check subscription status
    Access.swift
    let profile = try await Xee.getProfile()
    if profile.accessLevels["premium"]?.isActive ?? false {
        // unlock paid features
    }

What the SDK takes care of

Purchases checked by Apple

Every purchase is verified on the server and kept in step with Apple's notifications: renewals, refunds and billing issues.

Users across devices

Identify a user with your own ID and their access follows them to every device they sign in on.

The device's language

Paywall and view values arrive in the device's language, from the languages you choose.

Works offline

A fallback file ships in your app, so a paywall always shows, even before the first network call.

Your own events

Xee.track sends the steps of a flow, so a view test can be judged by any event you choose.

Fair test splits

The server gives each user one arm of a test and keeps it, on every device and after reinstalls.

Ready to grow for free

Every agent comes standard, and it is free until your app makes $5K a month.