iOS Swift SDK
Track screen views and custom events from native Swift apps without IDFA or cross-app tracking.
Install
- 1
Create a Mobile property
In the dashboard, choose Add Site, switch the type to Mobile, and enter your iOS bundle ID.
- 2
Add the Swift package
In Xcode, open File → Add Package Dependencies, add the Produl package repository, then add the
Produlproduct to your app target. - 3
Configure once at startup
Use the public site API key from your mobile property.
Usage
MyApp.swiftswift
import SwiftUI
import Produl
@main
struct MyApp: App {
init() {
Produl.configure(siteId: "YOUR_SITE_API_KEY")
}
var body: some Scene {
WindowGroup {
ContentView()
.onAppear {
Produl.trackScreen("/home", title: "Home")
}
}
}
}Custom events
swift
Produl.track("signup_completed", properties: [
"plan": "pro",
"source": "onboarding"
])
await Produl.flush()Privacy controls
The iOS SDK generates a random first-party visitor ID scoped to your app installation. It does not use IDFA and does not request App Tracking Transparency permission.
swift
Produl.setOptOut(true)
Produl.resetVisitorId()Mobile events use the same analytics pipeline
Screen views are stored as pageviews with an
app:// URL, so dashboards, live visitors, funnels, alerts, and custom event reports can work without a separate mobile-only backend.