Supported on: iOS SDK
1.0.61+ · Android SDK 1.0.33+ · React Native SDK 1.0.4+Requirements
Before integrating the AppDNA React Native SDK, ensure your project meets the following minimum requirements:| Requirement | Minimum Version |
|---|---|
| React Native | 0.70+ |
| Node | 18+ |
| iOS | 15.0+ |
| Android minSdk | 24 |
Installation
Install the AppDNA SDK package:React Native autolinking (0.60+) wires the native iOS and Android modules automatically — no manual
react-native link step is required.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/<YourApp>.xcworkspacein Xcode - Drag
GoogleService-Info-AppDNA.plistinto your app target’s folder in the project navigator - Ensure “Copy items if needed” is checked
- Select your app 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:
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
The@appdna/react-native-sdk package uses React Native’s native module bridge for rendering, storage, and network I/O. The TypeScript layer marshals method calls and emits events from the native side through NativeEventEmitter, so every feature reaches your React Native app at native performance with native UI primitives.
Native Modules and Events
The SDK registers the following native modules and event names:| Surface | Type | Purpose |
|---|---|---|
NativeModules.AppDNA | NativeModule | Primary SDK operations |
AppDNA_billing | Bridged methods | Billing and purchase operations |
AppDNA_web_entitlement_changed | Emitter event | Web entitlement change events |
AppDNA_push_received | Emitter event | Push notification received events |
AppDNA_push_tapped | Emitter event | Push notification tapped events |
AppDNA_entitlements_changed | Emitter event | Entitlement change events |
AppDNA_<module>_event | Emitter event | Per-module delegate event streams |
You do not need to interact with the native module bridge directly. The
AppDNA class and its module accessors provide a high-level TypeScript API that wraps all bridge communication.Native Dependencies
The React Native 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 TypeScript / JavaScript file where you need to use it:AppDNA static class, 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 Metro / Flipper / Xcode debug area. If the import fails, run
yarn install again and rebuild the native projects.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. |
Invariant Violation: Native module AppDNA is null | Re-run cd ios && pod install, then rebuild the iOS app from Xcode. On Android, run cd android && ./gradlew clean and rebuild. |
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. |
logLevel: 'debug' in AppDNAOptions during development to surface SDK activity.

