> ## Documentation Index
> Fetch the complete documentation index at: https://guide.daro.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started

> Integrate the DARO Flutter SDK into your app.

<Note>
  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.
</Note>

## Before You Begin

If you use an earlier SDK, start with the [migration guide](/en/sdk-integration-v2/flutter/migration-guide).

<Warning>
  Load all ads after `DaroFlutter.initialize()` completes. Display banner and native ad widgets only after initialization as well.
</Warning>

### 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 in `pubspec.yaml`.

```yaml theme={null}
dependencies:
  daro_flutter: 2.0.0
```

```bash theme={null}
flutter pub get
```

## Automatic Native Configuration

Use the `configure` and `doctor` commands in `daro_flutter 2.0.0` 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.

```yaml theme={null}
ios:
  integration_key: "YOUR_IOS_INTEGRATION_KEY"
android:
  integration_key: "YOUR_ANDROID_INTEGRATION_KEY"
```

Specify only `integration_key` for each platform.

Run these commands from your app root.

```bash theme={null}
dart run daro_flutter:configure
dart run daro_flutter:doctor
```

* `configure` applies the required Android and iOS settings. Run it again after updating the SDK or changing an Integration Key.
* `doctor` checks 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](#initializing-the-sdk).
* Build and run your app to verify SDK initialization and ad behavior.

## Configuring the Android Project

Follow [Android Getting Started](/en/sdk-integration-v2/android/get-started) to configure repositories, the DARO Gradle plugin, and the Integration Key. Use the native SDK dependency provided by `daro_flutter`.

* Apply the project settings under `android/`.
* Apply the `so.daro` plugin to the app module.
* Add your app's Integration Key inside `<application>` in `android/app/src/main/AndroidManifest.xml`.

```xml theme={null}
<meta-data
    android:name="DARO_INTEGRATION_KEY"
    android:value="YOUR_INTEGRATION_KEY" />
```

If minSdkVersion is below 26, also apply the desugaring settings in [Android Getting Started](/en/sdk-integration-v2/android/get-started).

## Configuring the iOS Project

Follow [iOS Getting Started](/en/sdk-integration-v2/ios_new/get-started) to install the build tools and configure the Integration Key, `SKAdNetworkItems`, and the tracking permission message in `ios/Runner/Info.plist`.

```xml theme={null}
<key>DaroIntegrationKey</key>
<string>YOUR_INTEGRATION_KEY</string>
```

`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.

```ruby theme={null}
post_install do |installer|
  hook = Dir.glob(File.expand_path('Pods/*/**/Scripts/daro_integration_key.rb', __dir__)).first
  raise '[Daro] Integration Key hook not found' unless hook
  require hook
  Daro::IntegrationKey.install!(installer)

  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end
```

<Warning>
  Use only one `post_install` block. Merge the hook into the existing block and keep any app-specific settings. Both the Integration Key and hook must be configured.
</Warning>

After running `flutter pub get`, run this command from `ios/`.

```bash theme={null}
pod install
```

## 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. Use `DaroGdprStatus`, `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.

```dart theme={null}
import 'package:flutter/material.dart';
import 'package:daro_flutter/daro_flutter.dart';

Future<void> startAppWithPrivacy({
  required DaroGdprStatus gdpr,
  required DaroCcpaStatus ccpa,
  required DaroCoppaStatus coppa,
  String? gdprConsentString,
  String? ccpaConsentString,
}) async {
  WidgetsFlutterBinding.ensureInitialized();
  await DaroFlutter.setGdpr(gdpr, consentString: gdprConsentString);
  await DaroFlutter.setCcpa(ccpa, consentString: ccpaConsentString);
  await DaroFlutter.setCoppa(coppa);
  await DaroFlutter.initialize();
  runApp(const MyApp());
}
```

## Verifying Ad Display

Complete the [app-ads.txt setup](/en/app-ads-txt-settings), then verify loading, display, dismissal, and callbacks for every ad format you use on a physical device.

* [Banner/MREC](/en/sdk-integration-v2/flutter/ad-formats/banner)
* [Native](/en/sdk-integration-v2/flutter/ad-formats/native): Register a factory on both Android and iOS.
* [Interstitial](/en/sdk-integration-v2/flutter/ad-formats/interstitial)
* [Rewarded](/en/sdk-integration-v2/flutter/ad-formats/rewarded)
* [Light Popup](/en/sdk-integration-v2/flutter/ad-formats/lightpopup)
* [App Open](/en/sdk-integration-v2/flutter/ad-formats/appopen)
