Core Methods
| Method | Signature | Description |
|---|---|---|
configure | AppDNA.configure(apiKey: String, environment: Environment, options: AppDNAOptions?) | Initialize the SDK. Call once at app launch. |
identify | AppDNA.identify(userId: String, traits: [String: Any]?) | Associate events with a user identity. |
reset | AppDNA.reset() | Clear user identity and flush events. Call on logout. |
track | AppDNA.track(event: String, properties: [String: Any]?) | Track a custom event with optional properties. |
flush | AppDNA.flush() | Force an immediate flush of all queued events. |
onReady | AppDNA.onReady(_ callback: @escaping () -> Void) | Register a callback for when the SDK is fully initialized. |
shutdown | AppDNA.shutdown() | Shut down the SDK, flush events, and release resources. |
setLogLevel | AppDNA.setLogLevel(_ level: LogLevel) | Change the SDK log level at runtime. |
setConsent | AppDNA.setConsent(analytics: Bool) | Set analytics consent. When false, events are dropped silently. |
Session Data Methods
| Method | Signature | Description |
|---|---|---|
setSessionData | AppDNA.setSessionData(key: String, value: Any) | Store a key-value pair in the session data store. |
getSessionData | AppDNA.getSessionData(key: String) -> Any? | Retrieve a session data value by key. |
clearSessionData | AppDNA.clearSessionData() | Clear all app-defined session data. |
getLocationData | AppDNA.getLocationData(fieldId: String) -> LocationData? | Get structured location data from an onboarding location field. Returns city, state, country, coordinates, timezone. |
Config Methods
| Method | Signature | Description |
|---|---|---|
getRemoteConfig | AppDNA.getRemoteConfig(key: String) -> Any? | Get a remote config value by key. |
forceRefreshConfig | AppDNA.forceRefreshConfig() | Force an immediate refresh of remote configuration. |
isFeatureEnabled | AppDNA.isFeatureEnabled(flag: String) -> Bool | Check if a feature flag is enabled. |
Experiment Methods
| Method | Signature | Description |
|---|---|---|
getExperimentVariant | AppDNA.getExperimentVariant(experimentId: String) -> String? | Get the assigned variant for an experiment. |
isInVariant | AppDNA.isInVariant(experimentId: String, variantId: String) -> Bool | Check if the user is in a specific variant. |
getExperimentConfig | AppDNA.getExperimentConfig(experimentId: String, key: String) -> Any? | Get a specific config value for an experiment variant. |
Push Methods
| Method | Signature | Description |
|---|---|---|
registerForPush | AppDNA.registerForPush() async -> Bool | Request push permission and register for remote notifications. |
setPushToken | AppDNA.setPushToken(_ deviceToken: Data) | Set the APNs device token manually. |
setPushPermission | AppDNA.setPushPermission(granted: Bool) | Update the push permission status. |
trackPushDelivered | AppDNA.trackPushDelivered(pushId: String) | Track that a push notification was delivered. |
trackPushTapped | AppDNA.trackPushTapped(pushId: String, action: String?) | Track that a push notification was tapped. |
Presentation Methods
| Method | Signature | Description |
|---|---|---|
presentOnboarding | AppDNA.presentOnboarding(flowId: String?, from: UIViewController, delegate: AppDNAOnboardingDelegate?) -> Bool | Present an onboarding flow. Returns false if config unavailable. |
presentPaywall | AppDNA.presentPaywall(id: String, from: UIViewController, context: PaywallContext?, delegate: AppDNAPaywallDelegate?) | Present a paywall by ID. |
Web Entitlements
| Member | Signature | Description |
|---|---|---|
webEntitlement | AppDNA.webEntitlement: WebEntitlement? | The current web entitlement, if any. |
onWebEntitlementChanged | AppDNA.onWebEntitlementChanged(_ callback: @escaping (WebEntitlement?) -> Void) | Register a callback for web entitlement changes. |
Deep Links
| Method | Signature | Description |
|---|---|---|
checkDeferredDeepLink | AppDNA.checkDeferredDeepLink(completion: @escaping (DeferredDeepLink?) -> Void) | Check for a deferred deep link from install attribution. |
Module Namespaces
Access module-specific functionality through these properties on theAppDNA singleton:
| Property | Type | Description |
|---|---|---|
AppDNA.pushModule | PushModule | Push notification registration, tokens, and delegates |
AppDNA.billing | BillingModule | Products, purchases, entitlements, and restore |
AppDNA.onboarding | OnboardingModule | Server-driven onboarding flow presentation |
AppDNA.paywall | PaywallModule | Server-driven paywall presentation |
AppDNA.remoteConfig | RemoteConfigModule | Remote configuration access |
AppDNA.features | FeaturesModule | Feature flag evaluation |
AppDNA.experiments | ExperimentsModule | Experiment variant assignment |
AppDNA.inAppMessages | InAppMessagesModule | In-app message display |
AppDNA.surveys | SurveysModule | User survey presentation |
AppDNA.deepLinks | DeepLinksModule | Deep link and deferred deep link handling |
Delegate Protocols
AppDNAPushDelegate
AppDNABillingDelegate
AppDNAOnboardingDelegate
AppDNAPaywallDelegate
AppDNAInAppMessageDelegate
AppDNASurveyDelegate
AppDNADeepLinkDelegate
Key Types
AppDNAOptions
Environment
LogLevel
BillingProvider
PaywallContext
OnboardingContext
PushPayload
PushAction
TransactionInfo
ProductInfo
Entitlement
WebEntitlement
DeferredDeepLink
PaywallAction
DismissReason
StepAdvanceResult
StepConfigOverride
FormFieldType
Server-Driven Screens
| Method | Signature | Description |
|---|---|---|
showScreen | AppDNA.showScreen(_ screenId: String, completion: ((ScreenResult) -> Void)?) | Present a server-driven screen by ID. |
showFlow | AppDNA.showFlow(_ flowId: String, completion: ((FlowResult) -> Void)?) | Present a multi-screen flow by ID. |
dismissScreen | AppDNA.dismissScreen() | Dismiss the currently presented screen or flow. |
enableNavigationInterception | AppDNA.enableNavigationInterception(forScreens: [String]?) | Enable automatic screen injection between navigations. Pass nil for all screens. |
disableNavigationInterception | AppDNA.disableNavigationInterception() | Disable navigation interception. |
previewScreen | AppDNA.previewScreen(json: String, completion: ((ScreenResult) -> Void)? = nil) | Preview a screen from raw JSON config. (DEBUG builds only) |
screenDelegate | AppDNA.screenDelegate: AppDNAScreenDelegate? | Set a delegate for screen lifecycle callbacks. |
isConsentGranted | AppDNA.isConsentGranted() -> Bool | Check if analytics consent has been granted. |
getUserTraits | AppDNA.getUserTraits() -> [String: Any] | Get the current user traits set via identify(). |
AppDNAScreenDelegate
ScreenResult
FlowResult
SectionAction
Properties
| Property | Type | Description |
|---|---|---|
AppDNA.sdkVersion | String | The current SDK version string (e.g., “1.0.0”). |
AppDNA.currentBundleVersion | Int | The current config bundle version number. |
AppDNA.configUpdated | Notification.Name | Notification posted when remote config is updated. |

