Update to DARO 2.0 SDK
Existing Ad Unit IDs continue to work with the DARO 2.0 SDK and do not need to be reissued or replaced. For new integrations or when copying a value, use the Ad Unit Key from the updated dashboard. Keep existing Ad Unit IDs in app versions that use the legacy SDK (before 2.0.0); newly created Ad Unit keys do not work with that SDK.
1. Update the dashboard
- In the DARO dashboard, select the app you are migrating and complete the update.
- Find the Integration Key and Ad Unit Keys for the Android app and the iOS app separately.
2. Remove legacy key files and settings
- Remove the legacy files used by your project:
daro-services.json, daro-service.json, daro-key.txt, android-daro-key.txt, and ios-daro-key.txt.
- Remove the legacy integration settings that reference these files.
- On iOS, also check file references and build resources in Xcode.
- Use the Integration Key from the dashboard for the corresponding Android or iOS app.
- On Android, enter the key in
DARO_INTEGRATION_KEY in AndroidManifest.xml.
- On iOS, enter the key in
DaroIntegrationKey in the source Info.plist.
- See Flutter get started for configuration examples.
- Run
pod install after configuring the iOS hook and completing the SDK update below.
5. Update app-ads.txt
- Follow the app-ads.txt guide and publish the latest content provided by the dashboard.
- Confirm that the file is accessible on the website registered in the dashboard.
6. Update SDK dependencies and code
- Update
pubspec.yaml to the daro_flutter version listed in Flutter get started.
- Remove any Podfile entry that directly pins the legacy SDK (before 2.0.0) and use the dependency provided by
daro_flutter.
- Install the package with the following command.
Initialization
- Load ads and display ad widgets only after
DaroFlutter.initialize() completes.
- See Flutter get started for the initialization example.
- Remove the
placement constructor argument from DaroInterstitialAd, DaroRewardedAd, DaroAppOpenAd, and DaroLightPopupAd.
- Review loading, display, and cleanup in the format guides below.
Verify before release
- Rebuild both Android and iOS apps.
- On a physical device, verify initialization and the loading, display, dismissal, and callbacks of every ad format your app uses.
- Also verify the reward callback if you use rewarded video ads.
- Keep existing Ad Unit IDs for released app versions that still use the legacy SDK (before 2.0.0).
Migrating Privacy APIs
Replace boolean hasGdprConsent, doNotSell, and isTaggedForChildDirectedTreatment settings with setGdpr(DaroGdprStatus), setCcpa(DaroCcpaStatus), and setCoppa(DaroCoppaStatus). Determine consent and applicability in your app, then await each call before initialization. See the initialization example.