Skip to main content
Breaking Changes: The 1.1.x SDK requires complete code modifications and is not compatible with 1.0.x code.
Configuration File: Update to the new unified configuration file format.

Project Configuration

1

Change Configuration File

  • Changed from daro-service.json to ios-daro-key.txt.
  • Info.plist: Set DaroAppKey
ios-daro-key.txt can be downloaded from the DARO Dashboard.
DaroAppKey can be found in the DARO Dashboard.

Code Migration

1

SDK Initialization Changes

SDK initialization has been unified for both reward and non-reward apps.New Code (Unified)
non-reward app >> import Daro
reward app >> import DaroM

// SDK initialization (unified)
DaroAds.shared.logLevel = .debug
DaroAds.shared.userId = "user_id" // Optional
DaroAds.shared.initialized { error in
    if let error = error {
        print("SDK initialization failed: \(error)")
    } else {
        print("SDK initialization complete")
    }
}
2

Ad Unit Creation Method Changes

Changed from ad type-specific structs to a unified struct.New Code (Unified)
// Unified ad unit struct
let adUnit = DaroAdUnit(unitId: "ad_unit_id")
// Specify placement (optional)
let adUnit = DaroAdUnit(unitId: "ad_unit_id", placement: "main_screen")
3

Listener Method Changes

Key Change: Changed from delegate pattern to listener closure-based pattern.
Common Listener Structure
// Listeners commonly used across all ad types
ad.listener.onAdLoadSuccess = { ad, adInfo in
    // Called when ad loads successfully
}

ad.listener.onAdLoadFail = { error in
    // Called when ad load fails
}

ad.listener.onAdImpression = { adInfo in
    // Called when ad is displayed
}

ad.listener.onAdClicked = { adInfo in
    // Called when ad is clicked
}
Ad Display Related Listeners
// Set ad display listeners
(interstitialListener | rewardedAdListener | appOpenAdListener )
.onShown = { adInfo in
    print("[DARO] Listener Sample Interstitial Ad shown: \(adInfo)")
}
(interstitialListener | rewardedAdListener | appOpenAdListener )
.onDismiss = { adInfo in
    print("[DARO] Listener Sample Interstitial Ad dismissed: \(adInfo)")
}
(interstitialListener | rewardedAdListener | appOpenAdListener )
.onFailedToShow = { adInfo, error in
    print("[DARO] Listener Sample Interstitial Ad failed to show: \(adInfo) \(error)")
}
Rewarded Ad Specific Listener
rewardedAd.rewardedAdListener.onEarnedReward = { rewardItem, adInfo in
    // Called when reward is earned
}
4

Ad Type-Specific Code Changes

Migration Checklist

1

Verify Project Configuration Changes

  • Check currently used SDK version (DaroAds or DaroMAds)
  • Organize list of existing ad unit IDs
  • Apply configuration file (daro-service.json -> ios-daro-key.txt)
  • Add DaroAppKey to Info.plist (check App ID in Daro Dashboard)
2

Code Changes

  • Update Podfile
  • Modify SDK initialization code
  • Modify ad unit creation code
  • Change from delegate methods to listener registration
  • Apply code changes for each ad format
3

Test Items

  • Confirm SDK initialization success
  • Test load/display for each ad type
  • Test ad interactions (clicks, impressions)
  • Verify listener calls

Troubleshooting

1

Common Issues

Following this migration guide will allow you to successfully migrate from the existing SDK to the new unified SDK. If you have additional questions or issues, please contact the DARO technical support team.