An Ad Unit defines an ad placement and format in your app. For the DARO 2.0 SDK, copy the Ad Unit Key from the updated dashboard. This is different from the app’s Integration Key. API parameters such as
adUnitId, unitId, and key, and example placeholders such as YOUR_AD_UNIT_ID, keep their names but take that Ad Unit’s Ad Unit Key. Existing integrations using Ad Unit IDs remain supported. Do not confuse reporting or callback identifiers with the key for a new integration.Before You Begin
Requirements
- Android minSdkVersion: 23
- iOS 15.1 or later
[email protected] uses Android so.daro:daro-sdk 2.0.0 and iOS DaroAds 2.0.0The wrapper and native SDK versions are managed independently.Please double-check that your app-ads.txt file is configured correctly.
Supported Ad Formats
- Banner/MREC
- Native
- Interstitial
- Rewarded
- Light Popup
Installing the Package
Configuring an Expo Project
The unified SDK ships an Expo config plugin. Provide your Integration Key in the app config and the plugin applies the Android and iOS native setup during prebuild.1
Add the plugin to your Expo config
Keep your existing Expo config and add the DARO entry to
expo.plugins. Each platform takes a single Integration Key.app.json
On iOS you can override the App Tracking Transparency prompt with
attUsageDescription. A default message is used when it is omitted.2
Run prebuild or EAS Build
If your project uses a dynamic Expo config, manage the app identifier through your existing Expo/EAS configuration.
Configuring a React Native CLI Project
If your project does not use the Expo config plugin, apply the build tools and Integration Key setup from Android Getting Started and iOS Getting Started. On Android, add theso.daro plugin and the so.daro:daro-sdk dependency to the app module. Match the Android SDK version specified on this page for the React Native package. Also add these React Native settings to android/gradle.properties, merging the entries with any existing ignore list.
DaroIntegrationKey, SKAdNetworkItems, the tracking permission message, and the post_install hook, then run pod install from ios/. Keep the existing React Native post_install settings and add the hook to the same block.
Initializing the SDK
Complete your app’s consent flow before initialization and pass the user’s choice and your app’s applicability decision. Theprivacy values below must come from your app; the example does not assume opt-in. GDPR accepts optIn, optOut, notApplicable, or unknown; CCPA accepts optIn, optOut, or notApplicable; COPPA accepts child or notChild. Set COPPA before initialization. Include any previously supplied consent string when updating its status.
Use the code below to initialize the SDK.
Supply privacy as a stable object after the consent flow completes; creating a new object on each render would repeat this initialization effect.
Best Practices
Managing SDK Initialization
Recommendations for managing the SDK efficiently and avoiding errors.Call initialize() at app startup- Initialize the SDK at your app entry point (App.js or index.js)
- Track initialization state
- Keep the initialization result in state so you can control when ads render
- Guard every banner and native ad component with conditional rendering
- Make sure ad components never render before initialization completes

