Requirements
Before integrating the AppDNA React Native SDK, ensure your project meets the following minimum requirements:| Requirement | Minimum Version |
|---|---|
| React Native | 0.72.0+ |
| React | 18.0+ |
| TypeScript | 5.0+ |
Installation
npm
yarn
Package Info
| Field | Value |
|---|---|
| Package | @appdna/react-native-sdk |
| Version | 1.0.0 |
Architecture
The@appdna/react-native-sdk package is a TypeScript thin wrapper around the native iOS and Android AppDNA SDKs. All core logic — event batching, config caching, billing, push handling — is delegated to the native modules via React Native’s NativeModules bridge.
The package has no runtime JavaScript dependencies. The Dart-level API marshals method calls down to the native side and surfaces results back as Promises and event listeners.
You do not need to interact with
NativeModules directly. The AppDNA class and its module accessors provide a high-level TypeScript API that wraps all native communication.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 the
ios/workspace in Xcode - Drag
GoogleService-Info-AppDNA.plistinto your Xcode 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 directory:
android/app/build.gradle:
android/build.gradle:
Step 4: Install React Native Firebase
Install the@react-native-firebase/app package:
React Native Firebase auto-initializes from the config files. You do not need to call any Firebase initialization method manually in your JavaScript/TypeScript code.
iOS Setup
After installing the npm package, install the native CocoaPods dependency:If
pod install fails, make sure your CocoaPods repo is up to date by running pod repo update first.Android Setup
No additional setup is needed for Android. The native module is auto-linked by React Native when you install the package.Import
Import the SDK in any TypeScript or JavaScript file where you need to use it:Verify Installation
After adding the dependency, verify the SDK is correctly installed by printing the version:You should see
1.0.0 printed in the Metro console. If the import fails, make sure you ran pod install for iOS and rebuilt the app. For Android, a clean rebuild (cd android && ./gradlew clean) may be needed.
