All methods are accessed through the static AudienceLabSDK API.
| Method | Returns | Description |
|---|
initialize(apiKey:options:) | — | Initialize the SDK. |
isInitialized | Bool | Whether the SDK has been initialized. |
reset() | — | Clears SDK state, token, queue, and persisted SDK data. |
setSDKEnabled(_:) | — | Master SDK toggle. |
getIsSDKEnabled() | Bool | Whether the SDK is enabled. |
toggleMetricsCollection(_:) | — | Enable or disable data collection. |
getIsMetricsCollection() | Bool | Whether data collection is enabled. |
setDebugEnabled(_:) | — | Enable or disable SDK debug logging. |
getIsDebugEnabled() | Bool | Whether SDK debug logging is enabled. |
isDevelopmentMode() | Bool | Whether the SDK is currently sending development traffic. |
| Method | Description |
|---|
sendPurchaseEvent(itemId:itemName:value:currency:status:transactionId:dedupeKey:) | Track a purchase and include total_purchase_value. |
sendAdEvent(adId:name:source:watchTime:reward:mediaSource:channel:value:currency:dedupeKey:) | Track an ad event and include total_ad_value. |
sendCustomEvent(name:params:dedupeKey:) | Track a custom event. |
sendUserMetrics() | Trigger retention metric sending if one is due. |
| Method | Description |
|---|
setUserProperty(key:value:isWhitelisted:) | Set a property using the legacy boolean scope. |
setUserProperty(key:value:set:) | Set a property using UserPropertySet. |
unsetUserProperty(key:isWhitelisted:) | Remove a property using the legacy boolean scope. |
unsetUserProperty(key:set:) | Remove a property using UserPropertySet. |
clearUserProperties(isWhitelisted:) | Clear one property set using the legacy boolean scope. |
clearUserProperties(_:) | Clear one property set using UserPropertySet. |
getWhitelistedUserProperties() | Returns the current wp properties. |
getBlacklistedUserProperties() | Returns the current bp properties. |
| Method | Description |
|---|
setAdvertisingId(_:) | Manually set IDFA after ATT consent. |
clearAdvertisingId() | Clear the manually set advertising ID. |
isIdentitySettled() | Whether the SDK identity state is considered settled. |
| Method | Returns | Description |
|---|
getCreativeToken() | String? | Stored creative token. |
verifyCreativeToken(_:completion:) | — | Validate a token against the backend. |
checkDataCollectionStatus(_:) | — | Check whether backend-side data collection is enabled. |
| Method | Returns | Description |
|---|
getSessionId() | String? | Current session ID. |
getSessionIndex() | Int | Current session index. |
getQueueSize() | Int | Number of queued events waiting to flush. |
setRequestResultCallback(_:) | — | Register request success/failure callback. |
clearRequestResultCallback() | — | Clear the request result callback. |
| Method | Returns | Description |
|---|
setRequestDebugListener(_:) | — | Register request debug listener. |
clearRequestDebugListener() | — | Clear request debug listener. |
getIdentityDebugSnapshot() | IdentityDebugSnapshot | Current identity diagnostic state. |
getTokenDebugSnapshot() | TokenDebugSnapshot | Current token diagnostic state. |
getDeviceDebugSnapshot() | DeviceDebugSnapshot | Current device diagnostic state. |
getQueueDebugSnapshot() | [QueueDebugEntry] | Current offline queue diagnostic state. |
| Method | Returns | Description |
|---|
getSDKVersion() | String | SDK version. |
getAppVersion() | String | Host app version. |
getRuntimeVersion() | String | iOS runtime version string. |
getTotalPurchaseValue() | Double | Lifetime cumulative purchase value. |
getTotalAdValue() | Double | Lifetime cumulative ad value. |