v1.2.0
What's New
Hardened First-Launch Attribution
Reduces attribution loss on first launch when the device or app is in a flaky state. Diagnosed against real production traffic where Apple-reported installs vastly exceeded SpendOwl-recorded attributions in small-volume geos / basic ads — a meaningful slice of the gap is recoverable on the SDK side.
Three reliability layers added to the attribution path:
-
Token retry —
AAAttribution.attributionToken()is retried with exponential backoff (5 attempts at 0 / 0.5 / 1 / 2 / 4s) on the transientAAAttributionErrorDomaincodes 1 (NetworkError) and 2 (InternalError). Code 3 (PlatformNotSupported) is permanent and short-circuits. -
Disk-persisted attribution queue — the attribution payload is written to a single-slot UserDefaults queue before the first send and cleared on success. If the user backgrounds or kills the app before the send completes, the next launch replays the persisted payload before attempting a fresh fetch.
-
Background task assertion — the attribution Task spawned in
SpendOwl.configure()is wrapped inUIApplication.beginBackgroundTask(...)on iOS so a quick backgrounding right after configure doesn't suspend the request. The expiration handler ends the task to avoid OS termination.
Other Changes
- PurchaseTracker —
NSLockinteractions extracted into sync helpers for Swift 6 strict-concurrency compatibility (silences async-context lock warnings). - Tests —
SpendOwlTests.swiftsplit into three feature-axis files (SpendOwlTests,EventQueueTests,AttributionTests); +9 new tests covering token retry success/exhaust/permanent-error, queue save/load/clear/persistence/corruption, positive replay, and failed-send retains-payload semantics.