Supported on: iOS SDK
1.0.61+1. Configure the SDK
Initialize AppDNA as early as possible in your app lifecycle. For UIKit apps, place this inapplication(_:didFinishLaunchingWithOptions:). For SwiftUI apps, use the App initializer.
UIKit
SwiftUI
For background event uploads in SwiftUI apps, use
@UIApplicationDelegateAdaptor and call AppDNA.registerBackgroundTasks() in didFinishLaunchingWithOptions.If you don’t have your own Firebase: Keep
FirebaseApp.configure() as shown above — it initializes AppDNA’s Firebase instance.If you already use Firebase (Analytics, Crashlytics, Realtime Database): Remove the FirebaseApp.configure() call entirely and just call AppDNA.configure(...). The SDK automatically picks up GoogleService-Info-AppDNA.plist and creates its own named Firebase instance. Your existing Firebase setup is not affected.Configuration Options
TheAppDNAOptions struct lets you customize SDK behavior:
Environment
TheEnvironment enum controls which backend environment the SDK targets:
Log Level
TheLogLevel enum controls console log verbosity:
Use
.debug during development to see all SDK activity. Switch to .warning or .none for production builds.Billing Provider
TheBillingProvider enum specifies which billing system to use:
2. Wait for Ready State
The SDK fetches remote configuration asynchronously. UseonReady to know when the SDK is fully initialized:
3. Identify Users
Once a user signs in, callidentify to associate events with their user ID:
Traits are merged with any previously set traits. You do not need to pass all traits on every call — only the ones that have changed.
4. Track Events
Track user actions withtrack:
flushInterval and batchSize settings.
5. Flush Events Manually
Force an immediate flush of all queued events:6. Set User Consent
Control whether the SDK collects and sends analytics data:7. Remote Config and Feature Flags
Retrieve server-side configuration values:8. Experiments
Get the variant assigned to a user for an experiment:9. Session Data
Store cross-module session data that can be used in template interpolation across onboarding flows, paywalls, and in-app messages:{{session.selected_plan}}.
10. Reset on Logout
When a user signs out, callreset to clear the user identity and flush any remaining events:
You now have the SDK configured, user identification, event tracking, remote config, experiments, and session data working. Continue to the module-specific guides for Push Notifications, Billing, Onboarding, and Paywalls.

