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

# Migration Guide

> Migrate from the legacy iOS SDK (before 2.0.0) to the DARO 2.0.1 SDK.

Read the [common migration guide](/en/new-daro-sdk/migration-guide), then complete the steps below in order.

<Note>
  Existing Ad Unit IDs continue to work with the DARO 2.0.1 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. See [legacy SDK (before 2.0.0) support](/en/new-daro-sdk/legacy-support) for the support scope.
</Note>

## 1. Update the dashboard

* In the DARO dashboard, select the app you are migrating and complete the update.
* Find its **Integration Key** and Ad Unit Keys.

## 2. Remove legacy key files and settings

* Remove `ios-daro-key.txt` from the project, its target membership, and **Copy Bundle Resources**.

* Also remove any legacy build scripts that read or copy this file.

* Remove manually entered app key settings and previous key injection steps used for your legacy DARO integration.

* The new Integration Key tool applies the required settings again; do not overwrite them with old values.

## 3. Configure DARO integration tools

* Choose your installation method in [Get Started](/en/sdk-integration-v2/ios_new/get-started#install-the-sdk).

* **CocoaPods:** Update the Podfile dependency and add the Integration Key `post_install` hook. If a hook already exists, add it to the same block.

* **SPM:** Update the package, then get the `Scripts/daro` tool from the SDK ZIP for that same version.

* For CocoaPods, remove the pods you used before 2.0.0 from the Podfile, then add the DARO 2.0.1 SDK.

* Swift apps use `DaroAds` and Objective-C apps use `DaroObjCBridge`. Apps that previously used `DaroMAds` or `DaroMObjCBridge` move to these same two pods.

* Use the version listed in [Get Started](/en/sdk-integration-v2/ios_new/get-started#install-the-sdk).

```ruby theme={null}
# Remove - only the lines you actually used
pod 'DaroAds', '1.x.x'
pod 'DaroObjCBridge', '1.x.x'
pod 'DaroMAds', '1.x.x'
pod 'DaroMObjCBridge', '1.x.x'
```

<Warning>
  * Objective-C apps and Swift apps installed with SPM must add `-ObjC` to the app target's **Build Settings > Other Linker Flags (`OTHER_LDFLAGS`)**.
  * Without this flag, the SDK does not work correctly, or some ad demand sources fail to load.
  * See [Other Linker Flags in Get Started](/en/sdk-integration-v2/ios_new/get-started#other-linker-flags).
</Warning>

## 4. Configure the Integration Key and app settings

* Add the key issued by the dashboard to the source `Info.plist` used by your app target.

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

* For CocoaPods, run `pod install --repo-update`.
* For SPM, apply the settings to the source file with the downloaded tool.

```bash theme={null}
./Scripts/daro platform-key --plist "/path/to/YourApp/Info.plist" --inject
```

* If Debug and Release use different Info.plist files, configure each file.
* Follow [Get Started](/en/sdk-integration-v2/ios_new/get-started) for the complete procedure.

### Update SKAdNetworkItems

* The DARO 2.0.1 SDK supports a different set of ad demand sources than versions before 2.0.0.

* Replace the existing `SKAdNetworkItems` array in your app's `Info.plist` with the list in [Configure Your App](/en/sdk-integration-v2/ios_new/get-started#configure-your-app).

* Ad demand sources missing from the list cannot receive SKAdNetwork attribution.

* Keep entries added by other SDKs, and if the same `SKAdNetworkIdentifier` appears twice, keep only one.

## 5. Update app-ads.txt

* Follow the [app-ads.txt guide](/en/app-ads-txt-settings) 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

### Module and initialization

* Remove legacy SDK (before 2.0.0) dependencies and imports, and use the DARO 2.0.1 SDK.
* The Swift module is `Daro` and the initialization entry point is `DaroAds.shared`.

```swift theme={null}
import Daro

DaroAds.shared.initialized { error in
    guard error == nil else {
        print("DARO initialization failed: \(String(describing: error))")
        return
    }
    // Load ads only after initialization succeeds in this callback.
}
```

* For Objective-C, install `DaroObjCBridge` and use this initialization API:

```objc theme={null}
#import <DaroObjCBridge/DaroObjCBridge.h>
#import <DaroObjCBridge/DaroObjCBridge-Swift.h>

[[DaroObjCAds shared] initializeWithCompletion:^(NSError * _Nullable error) {
    if (error) {
        NSLog(@"DARO initialization failed: %@", error.localizedDescription);
        return;
    }
    // Load ads after initialization succeeds.
}];
```

### Ad Units and callbacks

* Create Swift Ad Units with `DaroAdUnit(unitId:)`. Remove the legacy `placement` argument.
* Remove rewarded video ad calls to `setPlacement(_:)` and Objective-C `setPlacement:`.
* Register the `onPaidEvent` revenue callback on each ad instance.
* The legacy revenue plugin (`DaroPluginAdRevenue` in `DaroRevenuePlugin.xcframework`) and `registerPlugin(_:)` do not exist in the DARO 2.0.1 SDK. Remove that xcframework from the project and receive revenue data through `onPaidEvent`.
* Apply privacy settings using the APIs in [Privacy Management](/en/sdk-integration-v2/ios_new/control-privacy).

```swift theme={null}
// Before (versions before 2.0.0)
let unit = DaroAdUnit(unitId: "AD_UNIT_ID", placement: "PLACEMENT")
rewardedAd.setPlacement("PLACEMENT")
loader.registerPlugin(DaroPluginAdRevenue())

// DARO 2.0.1 SDK
let unit = DaroAdUnit(unitId: "AD_UNIT_ID")
rewardedAd.onPaidEvent = { revenue in
    print(revenue.valueMicros, revenue.currencyCode)
}
```

* Banner and native ads load automatically, so SDK initialization must already be complete when you create those views.
* If you need to create a view earlier, set `autoLoad: false` and call `loadAd()` after initialization succeeds.

### Check each ad format

* Use the guides below to verify loading, display, dismissal, and revenue callbacks for the formats used by your app.

* Also verify reward delivery for rewarded video ads.

* [Banner and MREC](/en/sdk-integration-v2/ios_new/ad-formats/bannerAndMREC)

* [Native](/en/sdk-integration-v2/ios_new/ad-formats/native)

* [Interstitial](/en/sdk-integration-v2/ios_new/ad-formats/interstitial)

* [Rewarded](/en/sdk-integration-v2/ios_new/ad-formats/rewarded)

* [App Open](/en/sdk-integration-v2/ios_new/ad-formats/appopen)

* [Light Popup](/en/sdk-integration-v2/ios_new/ad-formats/lightpopup)

## Verify before release

* Verify initialization and the loading, display, and cleanup of every ad format your app uses.
* Also verify reward callbacks and server callbacks if enabled.
* Confirm that the Integration Key and `SKAdNetworkItems` in `Info.plist` use the latest values.
* Keep existing Ad Unit IDs for released app versions that still use the legacy SDK (before 2.0.0).
