Skip to main content

Before You Begin

Check requirements before integration.

Requirements

  • Android minSdkVersion: 23
Verify app-ads.txt setup before proceeding.
Desugaring required: Configure desugaring if minSdk is below 26.
android {
    ...

    compileOptions {
        isCoreLibraryDesugaringEnabled = true
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }

    ...
}

...

dependencies {
    ...

    coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")

    ...
}

Configure Your App

1

Project-level build configuration

  1. Add maven repositories to the settings.gradle file.
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        ...
        maven { url = uri("https://artifact.bytedance.com/repository/pangle") }
        maven { url = uri("https://verve.jfrog.io/artifactory/verve-gradle-release") }
        maven { url = uri("https://cboost.jfrog.io/artifactory/chartboost-ads/") }
        maven { url = uri("https://repo.premiumads.net/artifactory/mobile-ads-sdk/") }
        maven { url = uri("https://repo.pubmatic.com/artifactory/public-repos") }
        maven { url = uri("https://s3.amazonaws.com/smaato-sdk-releases/") }
        maven { url = uri("https://android-sdk.is.com/") }
        maven { url = uri("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea") }
    }
}
2

Add the DARO plugin to build.gradle(root)

  1. Add the DARO plugin to the build.gradle(root) file.
Latest version
  • daro-plugin :
buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("so.daro:daro-plugin:1.0.13")
    }
}
3

Add Daro SDK

  1. Add the Daro SDK.
Latest version
  • daro-a :
  • daro-compose-util :
dependencies {
    ...
    implementation "so.daro:daro-a:1.4.3"
    implementation("so.daro:daro-compose-util:1.3.1") {
      // When using daro-a 1.4.0 or higher - exclude required to avoid duplicate class issues.
      exclude(group = "so.daro", module = "daro-core")
    }
    ...
}
4

Add android-daro-key.txt file

  1. Add the android-daro-key.txt file.
app/
└── android-daro-key.txt
android-daro-key.txt can be downloaded from the DARO dashboard.
5

Configure daroAppKey

  1. Configure daroAppKey.
daroAppKey can be found in the DARO dashboard.daroAppKey
6

Apply the DARO plugin to build.gradle(app)

  1. Apply the DARO plugin to build.gradle(app).
plugins {
    ...
    id("so.daro.a")
    ...
}
7

Apply ProGuard rules if needed

  • The daro SDK includes the following obfuscation rules in consumer-rules.pro, which are automatically merged during app build when adding the AAR via Gradle.
  • If you want to modify the obfuscation rules, please refer to the content below and apply them to your proguard-rules.pro file.
# Pangle (ByteDance)
-keep class com.bytedance.sdk.** { *; }

# Verve (PubNative)
-keepattributes Signature
-keep class net.pubnative.** { *; }
-keep class com.iab.omid.library.pubnativenet.** { *; }

# Amazon APS
-keep class com.amazon.** { *; }
-keep public class com.google.android.gms.ads.** { public *; }
-keep class com.iabtcf.** { *; }

# IronSource
-keepclassmembers class * implements android.os.Parcelable {
    public static final android.os.Parcelable$Creator *;
}
-keep class com.ironsource.adapters.** { *; }
-dontwarn com.ironsource.**
-dontwarn com.ironsource.adapters.**
-keepclassmembers class com.ironsource.** { public *; }
-keep public class com.ironsource.**
-keep class com.ironsource.adapters.** { *; }

# IronSource - AppLovin integration
-keepclassmembers class com.applovin.sdk.AppLovinSdk { static *; }
-keep public interface com.applovin.sdk.** { *; }
-keep public interface com.applovin.adview.** { *; }
-keep public interface com.applovin.mediation.** { *; }
-keep public interface com.applovin.communicator.** { *; }

# IronSource - AndroidX
-keep class androidx.localbroadcastmanager.content.LocalBroadcastManager { *; }
-keep class androidx.recyclerview.widget.RecyclerView { *; }
-keep class androidx.recyclerview.widget.RecyclerView$OnScrollListener { *; }

# IronSource - Android
-keep class * extends android.app.Activity

# Retrofit
-keep,allowobfuscation,allowshrinking interface retrofit2.Call
-keep,allowobfuscation,allowshrinking class retrofit2.Response

# Gson
-keepattributes Signature
-keepattributes *Annotation*
-dontwarn sun.misc.**
-keep class com.google.gson.** { *; }
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

# Kotlin Coroutines
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation

Initialize SDK

Important: Load Ads After Initialization
  • Initialize DARO SDK before loading ads by calling Daro.init().
  • Requesting ads before initialization may prevent proper display.
class AppApplication : Application() {

  override fun onCreate() {
    ...

    // Daro SDK initialization
    Daro.init(
      application = application,
      sdkConfig = Daro.SDKConfig.Builder()
          .setDebugMode(...) // (set log exposure, default : false)
          .setAppMuted(...) // (set app mute, default : false)
          .build()
    )
  }
}

App Mute Setting

For app open, banner, interstitial, rewarded, and rewarded interstitial ad formats, you can use the setAppMute(...) method to inform the Daro SDK that the app volume has been muted.
// Mute app
Daro.setAppMuted(true)


// Unmute app
Daro.setAppMuted(false)
App Mute Usage PrecautionsMuting the app can reduce video ad eligibility, which may decrease your app’s ad revenue. Only use this API when your app provides custom mute controls to users and the user’s mute decision is properly reflected in the API.