Skip to main content

Requirements

Before integrating the AppDNA Flutter SDK, ensure your project meets the following minimum requirements:
RequirementMinimum Version
Dart3.0+
Flutter3.10+
iOS15.0+
Android minSdk24
The Flutter SDK is a thin platform channel wrapper. All core logic is delegated to the native iOS and Android SDKs under the hood. Your project must meet the native platform requirements as well.

Installation

Add the AppDNA SDK to your pubspec.yaml:
dependencies:
  appdna_sdk: ^1.0.0
Then install dependencies:
flutter pub get

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

  1. Log into your AppDNA Console
  2. Go to Settings → SDK
  3. Click Download Firebase Config to download both:
    • GoogleService-Info-AppDNA.plist (for iOS)
    • google-services-appdna.json (for Android)

Step 2: Add iOS Configuration

  1. Open ios/Runner.xcworkspace in Xcode
  2. Drag GoogleService-Info-AppDNA.plist into the Runner folder in the project navigator
  3. Ensure “Copy items if needed” is checked
  4. Select the Runner target in the “Add to targets” section

Step 3: Add Android Configuration

Place the google-services-appdna.json file in the Android app module directory:
your-project/
  android/
    app/
      google-services-appdna.json    <-- place here
Ensure the Google Services plugin is applied in your android/app/build.gradle:
apply plugin: 'com.google.gms.google-services'
And the classpath is added to android/build.gradle:
buildscript {
    dependencies {
        classpath 'com.google.gms:google-services:4.4.0'
    }
}

Step 4: Add firebase_core Dependency

Add firebase_core to your pubspec.yaml:
dependencies:
  appdna_sdk: ^1.0.0
  firebase_core: ^2.24.0
Then install dependencies:
flutter pub get
Without the Firebase config files, the SDK cannot fetch remote configuration (paywalls, experiments, feature flags). Events will still be tracked, but remote features will not work.

Architecture

The appdna_sdk package uses Flutter platform channels to delegate all logic to the native iOS and Android SDKs. The Dart layer is intentionally thin — it marshals method calls and streams events from the native side.

Platform Channels

The SDK registers the following platform channels:
ChannelTypePurpose
com.appdna.sdk/mainMethodChannelPrimary SDK operations
com.appdna.sdk/billingMethodChannelBilling and purchase operations
com.appdna.sdk/web_entitlementEventChannelWeb entitlement change stream
com.appdna.sdk/push_receivedEventChannelPush notification received stream
com.appdna.sdk/push_tappedEventChannelPush notification tapped stream
com.appdna.sdk/entitlementsEventChannelEntitlement changes stream
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.

Import

Import the SDK in any Dart file where you need to use it:
import 'package:appdna_sdk/appdna_sdk.dart';

Verify Installation

After adding the dependency, verify the SDK is correctly installed by printing the version:
import 'package:appdna_sdk/appdna_sdk.dart';

void main() async {
  final version = await AppDNA.getSdkVersion();
  print(version); // "1.0.0"
}
You should see 1.0.0 printed in the debug console. If the import fails, run flutter pub get again and restart your IDE.

Next Steps

Once the SDK is installed, proceed to the Quickstart guide to configure the SDK and start tracking events.