Supported on: iOS SDK
1.0.61+ · Android SDK 1.0.33+ · Flutter SDK 1.0.3+Requirements
Before integrating the AppDNA Flutter SDK, ensure your project meets the following minimum requirements:| Requirement | Minimum Version |
|---|---|
| Dart | 3.0+ |
| Flutter | 3.10+ |
| iOS | 15.0+ |
| Android minSdk | 24 |
Installation
Add the AppDNA SDK to yourpubspec.yaml:
Firebase Configuration
The AppDNA SDK uses Firebase Firestore for real-time configuration delivery (paywalls, experiments, feature flags, onboarding flows). You must add Firebase configuration files for each platform your app targets.Step 1: Download Firebase Config Files
- Log into your AppDNA Console
- Go to Settings → SDK
- Click Download Firebase Config to download both:
GoogleService-Info-AppDNA.plist(for iOS)google-services-appdna.json(for Android)
Step 2: Add iOS Configuration
- Open
ios/Runner.xcworkspacein Xcode - Drag
GoogleService-Info-AppDNA.plistinto theRunnerfolder in the project navigator - Ensure “Copy items if needed” is checked
- Select the Runner target in the “Add to targets” section
Step 3: Add Android Configuration
Place thegoogle-services-appdna.json file in the Android app module directory:
android/app/build.gradle:
android/build.gradle:
Step 4: Add firebase_core Dependency
Addfirebase_core to your pubspec.yaml:
If your app already uses Firebase for your own services (Realtime Database, Analytics, Crashlytics), AppDNA automatically initializes a separate named Firebase instance using
GoogleService-Info-AppDNA.plist (iOS) and google-services-appdna.json (Android). Your existing Firebase setup is not affected. Just add the AppDNA config files alongside your own.Architecture
Theappdna_sdk package uses Flutter platform channels for rendering, storage, and network I/O. The Dart layer marshals method calls and streams events from the native side, so every feature reaches your Flutter app at native performance with native UI primitives.
Platform Channels
The SDK registers the following platform channels:| Channel | Type | Purpose |
|---|---|---|
com.appdna.sdk/main | MethodChannel | Primary SDK operations |
com.appdna.sdk/billing | MethodChannel | Billing and purchase operations |
com.appdna.sdk/web_entitlement | EventChannel | Web entitlement change stream |
com.appdna.sdk/push_received | EventChannel | Push notification received stream |
com.appdna.sdk/push_tapped | EventChannel | Push notification tapped stream |
com.appdna.sdk/entitlements | EventChannel | Entitlement changes stream |
com.appdna.sdk/events/<module> | EventChannel | Per-module delegate event streams |
You do not need to interact with platform channels directly. The
AppDNA class and its module accessors provide a high-level Dart API that wraps all channel communication.Native Dependencies
The Flutter SDK inherits the dependencies of the underlying native SDKs. These are resolved automatically by CocoaPods (iOS) and Gradle (Android):| Platform | Dependency | Version | Purpose |
|---|---|---|---|
| iOS | KeychainAccess | ~4.2.2 | Secure storage for tokens and IDs |
| iOS | FirebaseFirestore | ~11.0 | Real-time remote configuration sync |
| Android | Firebase BoM | latest | Firestore + analytics + messaging |
| Android | Play Billing | latest | In-app purchases and subscriptions |
If your project already includes these dependencies, ensure your version constraints are compatible with the versions above. CocoaPods and Gradle will resolve conflicts automatically in most cases.
Lottie and Rive animation support is provided by the native SDKs. On iOS, add
lottie-ios and rive-ios to your Podfile if you use those formats. On Android, the equivalent dependencies are bundled with the native AppDNA SDK.Import
Import the SDK in any Dart file where you need to use it:AppDNA entry point, every module accessor, the canonical delegate interfaces (AppDNAPushDelegate, AppDNAPaywallDelegate, AppDNAOnboardingDelegate, etc.), and all DTOs (Entitlement, ProductInfo, PurchaseResult, PaywallContext, …).
Verify Installation
After adding the dependency, verify the SDK is correctly installed by printing the version:You should see a version string printed in the debug console. If the import fails, run
flutter pub get again and restart your IDE.Troubleshooting
If you encounter issues during integration, callAppDNA.diagnose() after configuration to get a full health report:
| Issue | Fix |
|---|---|
| ❌ API Key: invalid format | Key must start with adn_live_ or adn_test_. Copy directly from Settings → SDK in the AppDNA Console. |
| ❌ Bootstrap: failed | Check API key and internet connection. |
| ❌ Firebase: no secondary app | Add GoogleService-Info-AppDNA.plist to your iOS target AND google-services-appdna.json to android/app/. |
| ⚠️ Firebase: using default app | Your own Firebase is being used instead of AppDNA’s — add the AppDNA-specific config file. |
MissingPluginException on configure | Run flutter clean && flutter pub get, then rebuild the iOS pods (cd ios && pod install) and the Android Gradle project. |
Build fails on iOS with BGTaskScheduler | The iOS native SDK registers background event uploads. Ensure your iOS deployment target is 15.0+ and the Background Modes → Background fetch capability is enabled if you customize background tasks. |
AppDNAOptions(logLevel: AppDNALogLevel.debug) during development to surface SDK activity.

