Skip to main content

Requirements

Before integrating the AppDNA iOS SDK, ensure your project meets the following minimum requirements:
RequirementMinimum Version
iOS16.0+
Swift5.9+
Xcode16+
Projects targeting iOS versions below 16.0 are not supported. The SDK uses Swift concurrency features and modern SwiftUI APIs that require iOS 16.0 as a minimum deployment target.

Installation

Add the AppDNA SDK to your project using Swift Package Manager:
  1. In Xcode, go to File > Add Package Dependencies…
  2. Enter the repository URL:
https://github.com/appdna-ai/appdna-sdk-ios.git
  1. Set the dependency rule to Up to Next Major Version starting from 1.0.54.
  2. Select the AppDNASDK package product and add it to your target.
Alternatively, add it directly to your Package.swift:
dependencies: [
    .package(url: "https://github.com/appdna-ai/appdna-sdk-ios.git", from: "1.0.54")
]
Then add the product to your target’s dependencies:
.target(
    name: "YourApp",
    dependencies: [
        .product(name: "AppDNASDK", package: "appdna-sdk-ios")
    ]
)

CocoaPods

Add the following to your Podfile:
pod 'AppDNASDK', '~> 1.0.54'
Then run:
pod install
The pod is published from the AppDNASDK.podspec in the SDK repository. Make sure your CocoaPods repo is up to date by running pod repo update if the pod is not found.

Firebase Configuration

The AppDNA SDK uses Firebase Firestore for real-time configuration delivery (paywalls, experiments, feature flags, onboarding flows). You must add a Firebase configuration file to your project.

Step 1: Download GoogleService-Info-AppDNA.plist

  1. Log into your AppDNA Console
  2. Go to Settings → SDK
  3. Click Download Firebase Config to download GoogleService-Info-AppDNA.plist

Step 2: Add to Your Xcode Project

  1. Drag GoogleService-Info-AppDNA.plist into your Xcode project navigator
  2. Ensure “Copy items if needed” is checked
  3. Select your app target in the “Add to targets” section

Step 3: Add Background Task Permission

Add the following to your app’s Info.plist to enable background event uploads:
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
    <string>ai.appdna.sdk.eventUpload</string>
</array>
// In AppDelegate.swift — must be called before AppDNA.configure()
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    AppDNA.registerBackgroundTasks()
    AppDNA.configure(apiKey: "YOUR_API_KEY")
    return true
}
Without GoogleService-Info-AppDNA.plist, the SDK cannot fetch remote configuration (paywalls, experiments, feature flags). Events will still be tracked, but remote features will not work.
If your app already uses Firebase for your own services (Realtime Database, Analytics, Crashlytics), AppDNA automatically creates a separate named Firebase instance using GoogleService-Info-AppDNA.plist. Your existing Firebase setup is not affected. Just add the AppDNA plist alongside your own GoogleService-Info.plist.

Dependencies

The following dependencies are automatically included with the SDK. You do not need to add them manually:
DependencyVersionPurpose
KeychainAccess~4.2.2Secure storage for tokens and IDs
FirebaseFirestore~11.0Real-time remote configuration sync
If your project already includes these dependencies, ensure your version constraints are compatible with the versions listed above. SPM and CocoaPods will resolve version conflicts automatically in most cases.
Lottie and Rive animation support requires adding lottie-ios and rive-ios as separate SPM dependencies in your project.

Verify Installation

After adding the SDK, verify it is correctly installed by importing the module and printing the SDK version:
import AppDNASDK

print(AppDNA.sdkVersion) // "1.0.54"
If the import succeeds and the version prints correctly, the SDK is ready to configure.
You should see 1.0.54 printed in the Xcode console. If you get a “No such module” error, clean your build folder (Cmd+Shift+K) and rebuild.

Troubleshooting

If you encounter issues during integration, call AppDNA.diagnose() after configuration to get a full health report:
// Call a few seconds after configure() to allow bootstrap to complete
DispatchQueue.main.asyncAfter(deadline: .now() + 5) {
    AppDNA.diagnose()
}
This prints a diagnostic report to the Xcode console:
╔══════════════════════════════════════════
║  AppDNA SDK Diagnostic Report  v1.0.54
╠══════════════════════════════════════════
║ ✅ API Key: sandbox key (adn_test_...50ef)
║ ✅ Environment: sandbox
║ ✅ Bootstrap: orgId=..., appId=...
║ ✅ Firebase: secondary app 'appdna' configured
║ ✅ Identity: anonId=a1b2c3d4...
║ ✅ Event Queue: initialized
║ ✅ Remote Config: initialized
║ ✅ Modules: paywalls, onboarding, messages, surveys, billing, push, experiments
╠══════════════════════════════════════════
║ ✅ SDK is fully operational
╚══════════════════════════════════════════
Any items marked with indicate a configuration issue. Common fixes:
IssueFix
❌ API Key: invalid formatKey must start with adn_live_ or adn_test_
❌ Bootstrap: failedCheck API key and internet connection
❌ Firebase: no secondary appAdd GoogleService-Info-AppDNA.plist to your target
⚠️ Firebase: using default appYour own Firebase is being used instead of AppDNA’s — add GoogleService-Info-AppDNA.plist

Next Steps

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