Skip to content

v1.5.1

@VistaApps-za VistaApps-za tagged this 29 May 10:23
match StoreKit's contract — `Product.PurchaseOption.appAccountToken`
takes a `UUID`, not a `String`, so the snippet in the 1.5.0 release
notes would not compile when pasted as-is. Caught by a dogfood
integrator before 1.5.0 reached anyone else. No behavioural change
beyond the type — the persisted storage representation is unchanged.

**Changed:**

- **`Crossdeck.appAccountTokenForCurrentIdentity()` now returns
  `UUID` instead of `String`.** The helper still mints a single
  RFC 4122 random UUID v4 per install, persists it under
  `crossdeck.apple_app_account_token`, and returns the same value
  forever until `reset()`. The string form is what crosses the
  wire to the backend on `identify()`; the `UUID` form is what
  StoreKit demands at purchase time. Source-incompatible only if
  you were storing the return value in a `String` — replace with
  `UUID` and the rest of the call site is unchanged.

  Corrected snippet:

  ```swift
  let token: UUID = Crossdeck.appAccountTokenForCurrentIdentity()
  let result = try await product.purchase(options: [
      .appAccountToken(token)
  ])
  ```

- **Doc-comment expanded to cover the anonymous-user / pre-identify
  case.** Three properties are now spelled out on the helper itself
  so integrators don't have to second-guess from release notes:

  1. **Never returns `nil`.** Even before the first `identify()`
     call, the helper lazy-mints a UUID and returns it. Purchases
     made while the SDK only knows the anonymous identity still get
     a stable token.
  2. **Not derived from `anonymousId`.** It is a fresh random UUID,
     independent of every other Crossdeck identifier. Rotating or
     resetting `anonymousId` does not affect it.
  3. **Persists across `identify()`.** When the developer later
     calls `identify("user_123")`, the SDK forwards the existing
     token alongside the alias request so the backend can bind
     `appAccountToken → developerUserId` without minting a new one.
     Past purchases stay attributed to the same chain.

  `reset()` is the only thing that wipes it, by design — the next
  user on the same device must not inherit the prior user's token.
Assets 2
Loading