Client SDKs

Troubleshooting

Common issues and solutions for the AudienceLab iOS SDK

SDK Not Initializing

Symptom: isInitialized remains false after calling initialize.

Checks:

  • verify the API key is non-empty
  • ensure initialization happens early in app startup
  • confirm the app can reach the AudienceLab backend

Creative Token Stays Empty

Symptom: getCreativeToken() stays empty or falls back to organic#ios.

This can happen when:

  • no attribution match was found
  • the API key is invalid
  • network requests are failing

Checks:

  • verify the API key
  • enable SDK debug logging
  • inspect request failures through the request debug listener

Events Stay Queued

Symptom: events are queued but do not flush.

Expected behavior:

  • the SDK queues events until a valid creative token is available
  • queued events flush automatically after token availability or when connectivity returns

Checks:

  • verify getQueueSize()
  • confirm token status with getTokenDebugSnapshot()
  • confirm SDK and metrics toggles are enabled

IDFA Is Missing

Symptom: you expected an IDFA but it does not appear in the SDK payload.

Expected behavior:

  • the SDK does not request ATT or collect IDFA on its own

Action:

  • if your app has ATT consent and an IDFA available, pass it with setAdvertisingId(_:)

Session Events Seem Wrong

Symptom: session rollover or session start/end behavior looks incorrect.

Expected behavior:

  • sessions roll over after 30 minutes of inactivity
  • background/foreground transitions can trigger rollover when the timeout is exceeded

Checks:

  • ensure the SDK initializes before the app becomes active
  • inspect getSessionId() and getSessionIndex()
  • inspect queued or sent session payloads through the request debug listener

Retention Events Are Missing

Symptom: you expected a retention metric but do not see one.

Expected behavior:

  • retention is prepared automatically at launch
  • retention sends automatically once per day after token flow succeeds

Checks:

  • verify the app obtained a valid creative token
  • verify the SDK is initialized and metrics collection is enabled
  • remember that retention will not send repeatedly on the same day