Skip to content

v1.2.0

Choose a tag to compare

@emreozdil emreozdil released this 06 May 14:23
· 2 commits to main since this release
ee45307

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 retryAAAttribution.attributionToken() is retried with exponential backoff (5 attempts at 0 / 0.5 / 1 / 2 / 4s) on the transient AAAttributionErrorDomain codes 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 in UIApplication.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

  • PurchaseTrackerNSLock interactions extracted into sync helpers for Swift 6 strict-concurrency compatibility (silences async-context lock warnings).
  • TestsSpendOwlTests.swift split 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.