iOS SDK
Native SwiftUI paywalls with StoreKit 2 and RevenueCat adapters. Requires iOS 16+.
Install
In Xcode: File → Add Package Dependencies and enter the repository URL. Then add the products you need: Experiwall (always) plus ExperiwallStoreKit or ExperiwallRevenueCat.
swift
.package(url: "https://github.com/marcelo-earth/experiwall-ios", from: "0.1.0")Setup
swift
import SwiftUI
import Experiwall
import ExperiwallRevenueCat
@main
struct MyApp: App {
@StateObject var experiwall = ExperiwallSDK(
apiKey: "ew_pub_...",
purchaseHandler: RevenueCatPurchaseHandler()
)
var body: some Scene {
WindowGroup {
ContentView()
.experiwall(experiwall)
.paywallSheet()
.task {
await experiwall.identify(userId: "user_123")
try? await experiwall.loadConfig()
}
}
}
}Show a paywall
swift
struct ContentView: View {
@EnvironmentObject var experiwall: ExperiwallSDK
var body: some View {
Button("Upgrade") {
experiwall.present("paywall_abc")
}
}
}Placements
Use placements to let Experiwall pick the right paywall and A/B variant automatically based on your campaign rules.
swift
await experiwall.presentPlacement("onboarding_complete")Targets
The SDK is split into three Swift Package targets so you only ship what you need:
Experiwall— core SDK, networking, andPaywallView. Always required.ExperiwallStoreKit—StoreKitPurchaseHandlerbacked by StoreKit 2.ExperiwallRevenueCat—RevenueCatPurchaseHandlerbacked by the RevenueCat SDK.