Lightweight mobile attribution SDK for iOS. Tracks installs, events, and campaign attribution with offline support and Apple Ads integration.
Add this package in Xcode:
- File > Add Package Dependencies
- Enter:
https://github.com/getappsprint/appsprint-ios-sdk - Select version rule: "Up to Next Major" from
1.1.3
Or add to your Package.swift:
dependencies: [
.package(url: "https://github.com/getappsprint/appsprint-ios-sdk", from: "1.1.3")
]pod 'AppSprintSDK', '~> 1.1.3'import AppSprintSDK
// Configure on app launch
let config = AppSprintConfig(apiKey: "as_live_your_api_key")
await AppSprint.shared.configure(config)
// Track events
await AppSprint.shared.sendEvent(.purchase, name: "premium_upgrade", params: ["price": 9.99])
// Get attribution
if let attribution = AppSprint.shared.getAttribution() {
print("Source: \(attribution.source)")
}let config = AppSprintConfig(
apiKey: "as_live_...", // Required
apiURL: URL(string: "https://api.appsprint.app")!, // Default
enableAppleAdsAttribution: true, // Default: true
isDebug: false, // Default: false
logLevel: .warn, // Default: .warn
customerUserId: nil, // Optional
autoTrackSessions: true, // Default: true. Auto-fires .sessionStart on
// configure() and foreground, debounced 30 min.
autoRefreshAttribution: true // Default: true. Refreshes attribution on
// configure() and foreground so server-side
// late resolution propagates.
)// Lifecycle
AppSprint.shared.configure(_ config: AppSprintConfig) async
AppSprint.shared.destroy()
AppSprint.shared.isInitialized -> Bool
// Events
AppSprint.shared.sendEvent(_ type: AppSprintEventType, name: String?, params: [String: Any]?) async
AppSprint.shared.sendTestEvent() async -> TestEventResult
AppSprint.shared.flush() async
// Attribution
AppSprint.shared.getAttribution() -> AttributionResult?
AppSprint.shared.getAttributionParams() -> [String: String]
AppSprint.shared.getAppSprintId() -> String?
AppSprint.shared.refreshAttribution() async -> AttributionResult?
AppSprint.shared.enableAppleAdsAttribution() -> Bool
// User
AppSprint.shared.setCustomerUserId(_ userId: String) async
// State
AppSprint.shared.isSdkDisabled() -> Bool
AppSprint.shared.clearData()sessionStart, login, signUp, register, purchase, subscribe, startTrial, addPaymentInfo, addToCart, addToWishlist, initiateCheckout, viewContent, viewItem, search, share, tutorialComplete, achieveLevel, levelStart, levelComplete, custom
The XCFramework ships a PrivacyInfo.xcprivacy manifest. Match these entries in your App Store privacy details when you submit a build:
| Manifest entry | What it declares |
|---|---|
NSPrivacyAccessedAPICategoryUserDefaults (reason CA92.1) |
The SDK reads/writes its own UserDefaults keys for install state, queued events, attribution cache, and retry flags. |
NSPrivacyCollectedDataTypeDeviceID (Linked, Tracking) |
IDFA (when ATT is authorized), IDFV, and the SDK's own appsprintId are collected for analytics and third-party advertising attribution. |
NSPrivacyCollectedDataTypeProductInteraction (Linked, Tracking) |
Event names, params, revenue, currency, and timestamps collected for analytics and third-party advertising attribution. |
NSPrivacyCollectedDataTypeUserID (Linked, Tracking) |
customerUserId, when configured by the host app, is collected for install/event linking and attribution exports. |
NSPrivacyCollectedDataTypeCoarseLocation (Linked, Tracking) |
Server-side request metadata can derive coarse geography for analytics and attribution reporting. |
NSPrivacyCollectedDataTypeOtherDataTypes (Linked, Tracking) |
Custom event parameters are developer-defined and may include app-specific analytics fields. |
NSPrivacyTracking: true |
The SDK is a tracking SDK in Apple's terminology. |
NSPrivacyTrackingDomains |
api.appsprint.app - the SDK's ingest endpoint. |
Required host-app Info.plist entries:
NSUserTrackingUsageDescriptionis required if you callAppSprintNative.requestTrackingAuthorization()or otherwise request IDFA access.NSAdvertisingAttributionReportEndpointis required if you use SKAdNetwork postbacks.
Do not put raw user PII into params for sendEvent or into customerUserId. Both are persisted to UserDefaults for retry durability; Apple documents UserDefaults as storage for nonsensitive settings.
- iOS 14.0+
- Swift 5.9+
- Xcode 15+
MIT License. See LICENSE for details.