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.
  • Non-Reward
  • Reward
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 : androidPlguinLatestVersion
  • Non-Reward
  • Reward
buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("so.daro:daro-plugin:{version}")
    }
}
3

Add Daro SDK

  1. Add the Daro SDK.
  • Non-Reward
  • Reward
Latest version
  • daro-core : androidCoreLatestVersion
  • daro-a : androidDaroLatestVersion
  • daro-compose-util : androidComposeLatestVersion
dependencies {
    ...
    implementation("so.daro:daro-core:{version}")
    implementation("so.daro:daro-a:{version}")

    implementation("so.daro:daro-compose-util:{version}") // Compose-Only
    ...
}
4

Add android-daro-key.txt file

  1. Add the android-daro-key.txt file.
  • General
  • Separate configuration per flavor/buildType
app/
└── android-daro-key.txt
android-daro-key.txt can be downloaded from the DARO dashboard.
5

Configure daroAppKey

  1. Configure daroAppKey.
  • General
  • Separate configuration per flavor/buildType
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).
  • Non-Reward
  • Reward
plugins {
    ...
    id("so.daro.a")
    ...
}
7

Add proguard rules

  1. Add proguard rules.
  • Non-Reward
  • Reward
-keep class com.bytedance.sdk.** { *; }

-keepattributes Signature
-keep class net.pubnative.** { *; }
-keep class com.iab.omid.library.pubnativenet.** { *; }

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

-keep public class com.smaato.sdk.** { *; }
    -keep public interface com.smaato.sdk.** { *; }

-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.** { *;
}

-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** {*; }

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

-keep class * extends android.app.Activity

-flattenpackagehierarchy droom.daro.a

-keep public class droom.daro.** {
    public protected *;
}
-keep interface droom.daro.** {
    public protected *;
}

-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)
          .setAppMute(...) // (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.setAppMute(true)


// Unmute app
Daro.setAppMute(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.