An Ad Unit defines an ad placement and format. Pass its Ad Unit Key from the dashboard to the ad API. This differs from the app’s Integration Key. Existing Ad Unit IDs (UUIDs) remain valid inputs.
Before You Begin
If you use an earlier SDK, start with the migration guide.Requirements
- Flutter 3.24.0 or later, Dart 3.5.0 or later
- Android minSdkVersion 23, Kotlin 2.2 or later
- iOS 13.0 or later. If your Flutter version requires a higher deployment target, follow that requirement.
Installing the Package
Specify the package version inpubspec.yaml.
daro_flutter 2.0.6 uses Android SDK 2.0.9, iOS DaroAds 2.0.8, and Android Gradle plugin 2.0.5.
After updating, rebuild your Android and iOS apps to apply the native dependency changes.
Automatic Native Configuration
Use theconfigure and doctor commands in daro_flutter to apply and check native configuration.
After installing the package, create daro.yaml beside your app’s pubspec.yaml. Use the Integration Key for each platform’s app and omit platforms you do not build.
integration_key for each platform. If Android builds encounter a SafeDK error, follow Resolving SafeDK Build Errors below.
Run these commands from your app root.
configureapplies the required Android and iOS settings. Run it again after updating the SDK or changing an Integration Key.doctorchecks your configuration. Follow its instructions to resolve any issues.- Automatic setup supports standard Flutter projects. If your customized project structure is unsupported, follow the manual steps below.
- Remove conflicts with existing manual DARO settings, and do not add settings already applied automatically.
- Configure app-specific permissions, including the iOS tracking permission description, then continue to Initializing the SDK.
- Build and run your app to verify SDK initialization and ad behavior.
Integration Keys per Build Variant
If your Android flavors or build types use different DARO apps, follow Use a different Integration Key per build variant to configure their keys.Resolving SafeDK Build Errors
If an Android Release build reports a Configuration Cache error in asafedk* or process…Manifest task, update to daro_flutter 2.0.1 or later and add this option to the Android section of daro.yaml.
daro_flutter 2.0.6, configure applies DARO plugin 2.0.5 to your Android project and writes daro.safedkConfigurationCacheWorkaround=true to android/gradle.properties. The Android native SDK version is 2.0.9.
Set the option to false to disable the workaround. Omitting it preserves the existing Gradle value, so disabling a previously enabled workaround requires setting false and running configure again. If neither the option nor an existing Gradle value is present, the workaround is inactive. Write true and false without quotes.
For manually configured Android projects, follow the SafeDK troubleshooting steps in Android Getting Started to apply plugin 2.0.5 and the Gradle property directly.
Configuring the Android Project
Follow Android Getting Started to configure repositories, the DARO Gradle plugin, and the Integration Key. Use the native SDK dependency provided bydaro_flutter.
- Apply the project settings under
android/. - Apply the
so.daroplugin to the app module. - Add your app’s Integration Key inside
<application>inandroid/app/src/main/AndroidManifest.xml.
Configuring the iOS Project
Follow iOS Getting Started to install the build tools and configure the Integration Key,SKAdNetworkItems, and the tracking permission message in ios/Runner/Info.plist.
daro_flutter provides the DaroAds dependency, so do not add the same SDK again to the Podfile. Add the following hook to the existing post_install block and keep the Flutter build settings.
flutter pub get, run this command from ios/.
Initializing the SDK
Complete your app’s consent flow, then pass the user’s choice and your app’s applicability decision to the function below. UseDaroGdprStatus, DaroCcpaStatus, and DaroCoppaStatus without assuming opt-in. Await these settings, including COPPA, before initialization. Include the corresponding consent string when updating a status. MyApp is your app’s root widget. In your app entrypoint, call WidgetsFlutterBinding.ensureInitialized() before using consent plugins, then call startAppWithPrivacy when the results are ready.
App Mute Setting
CallDaroFlutter.setAppMuted to pass your app’s mute state to the DARO SDK. This API is available on Android and iOS. Update it whenever the user changes your app’s mute setting.
Verifying Ad Display
Complete the app-ads.txt setup, then verify loading, display, dismissal, and callbacks for every ad format you use on a physical device.- Banner/MREC
- Native: Register a factory on both Android and iOS.
- Interstitial
- Rewarded
- Light Popup
- App Open

