Preparing Mediated Networks - cleveradssolutions/CAS-Android Wiki

:zap: Before you start
Make sure you have correctly setup project settings.


This page shows you how to integrate CAS mediation network adapters in your app.

Add Maven repositories

Open the project-level build.gradle, and add the following repositories block:

allprojects {
  repositories {
     google()
     mavenCentral()
     maven { url "https://android-sdk.is.com/" } //IronSource
     maven { url "https://aa-sdk.s3-eu-west-1.amazonaws.com/android_repo" } //SuperAwesome
     maven { url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea" } //Mintegral
     maven { url "https://artifact.bytedance.com/repository/pangle" } //Pangle
     maven { url "https://s3.amazonaws.com/smaato-sdk-releases/" } // Smaato
     maven { url "https://sdk.tapjoy.com/" } //TapJoy
  }
}

⭐ Starting from version 2.1.2 Clever Ads Solution migrated from Bintray to MavenCentral.

Solutions

Clever Ads Solutions provide ready-made solutions for you to choose from.
Such solutions do not require you to add each network adapter separately in dependencies. One dependency per solution is enough.

dependencies {
    implementation 'com.cleveradssolutions:cas:2.6.2' 
}
dependencies {
    implementation 'com.cleveradssolutions:cas-families:2.6.2' 
}

⭐ To receive release updates Subscribe

In the table you can see which partners are included in the solutions.

Network Banner Interstitial Rewarded Optimal Families Privacy Policy Notes
CAS Base :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: link Notes
Google Ads :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: link Notes
Unity Ads :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: link Notes
IronSource :heavy_minus_sign: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: link Notes
AdColony :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: link Notes
Kidoz :white_check_mark: :white_check_mark: :white_check_mark: :heavy_minus_sign: :white_check_mark: link Notes
SuperAwesome :white_check_mark: :white_check_mark: :white_check_mark: :heavy_minus_sign: :white_check_mark: link Notes
Vungle :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: link Notes
AppLovin :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: link Notes
InMobi :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: link Notes
Facebook AN :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :heavy_minus_sign: link Notes
MyTarget :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :heavy_minus_sign: link Notes
Mintegral :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :heavy_minus_sign: link Notes
Pangle :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :heavy_minus_sign: link Notes
Tapjoy :heavy_minus_sign: :white_check_mark: :white_check_mark: :white_check_mark: :heavy_minus_sign: link :heavy_minus_sign:
Yandex Ads :white_check_mark: :heavy_minus_sign: :heavy_minus_sign: :heavy_minus_sign: :heavy_minus_sign: link Notes

Google Families Ads Program

🌟 If your application does not participate in Families Ads program, then you can safely skip steps Advertising ID and App set ID.

Google is focused on providing a great experience for families on Google Play and wants to help make sure that any ads served to children are appropriate and compliant with our policies. Review google ads and monetization policy in the Developer Policy Center.

If your app's target audience includes children and serves ads using an ad SDK, you must use one of the ad SDKs below. The following ad SDKs have self-certified that their compliance with Play’s хFamilies Ads Program](https://play.google.com/about/monetization-ads/families-ads-program/) requirements.

Quote from the Google Families Ads program page.

Advertising ID

The advertising ID is a unique, user-resettable ID for advertising, provided by Google Play services.

With Android 12 many mediation partners are starting to include the com.google.android.gms.permission.AD_ID permission in the SDK’s library manifest but Families Policy, require that apps not use the Ad ID.
You must prevent the permission from getting merged into your app by including the following element in your manifest. To do this, just add the following line to your app AndroidManifest.xml file inside the <manifest> tag but outside the <application> tag:

<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>
</manifest>

App set ID

Add dependency for App set ID for use cases such as reporting and fraud prevention instead of the Advertising ID.

You can add App set ID dependencies to your application in build.gradle script:

dependencies {
  implementation 'com.google.android.gms:play-services-tasks:17.2.1'
  implementation 'com.google.android.gms:play-services-appset:16.0.0'
}

Advanced Integration

Advanced integration makes it possible to choose any variations of mediation networks.
Feel free not to use ready-made (cas or cas-families) solutions, and choose which mediated ad networks you want to integrate by copy following dependencies to build.gradle file.

:zap: Note: When you are not using a ready-made solution, you must add a CAS Base (cas-sdk) dependency.

⚠️ Adapter versions are updated frequently and you should use the latest versions.
To receive release updates Subscribe

dependencies {
  implementation 'com.cleveradssolutions:cas-sdk:2.6.2'        // CAS Base
  implementation 'com.cleveradssolutions:google:20.5.0.1'      // Google Ads | Admob
  implementation 'com.cleveradssolutions:unity:4.0.0.0'        // Unity Ads
  implementation 'com.cleveradssolutions:ironsource:7.1.14.0'  // IronSource
  implementation 'com.cleveradssolutions:adcolony:4.6.5.0'     // AdColony
  implementation 'com.cleveradssolutions:kidoz:8.9.4.2'        // Kidoz
  implementation 'com.cleveradssolutions:superawesome:8.1.6.2' // SuperAwesome
  implementation 'com.cleveradssolutions:vungle:6.10.3.3'      // Vungle
  implementation 'com.cleveradssolutions:applovin:11.0.0.0'    // AppLovin
  implementation 'com.cleveradssolutions:inmobi:10.0.1.2'      // InMobi
  implementation 'com.cleveradssolutions:facebook:6.8.0.1'     // Facebook AN
  implementation 'com.cleveradssolutions:mytarget:5.14.4.4'    // MyTarget
  implementation 'com.cleveradssolutions:mintegral:15.8.1.3'   // Mintegral
  implementation 'com.cleveradssolutions:pangle:4.1.1.9'       // Pangle
  implementation 'com.cleveradssolutions:tapjoy:12.9.0.0'      // Tapjoy
  implementation 'com.cleveradssolutions:yandex:4.5.0.1'       // Yandex Ads
}

Starting from version CAS 2.6.1, all adapters have been migrated to the com.cleveradssolutions dependency group and it is no longer necessary to add network SDK dependencies.

Additional instructions

Some networks require additional steps to comply with policies or to correct known issues.

Facebook Data Processing Options

For information about how to implement Facebook’s Limited Data Use flag in California, visit Facebook’s developer documentation.

If you do not want to enable Limited Data Use (LDU) mode, pass an empty string array:

com.facebook.ads.AdSettings.setDataProcessingOptions( new String[] {} );  

To enable LDU for users and specify user geography, call setDataProcessingOptions in a form like this:

com.facebook.ads.AdSettings.setDataProcessingOptions( new String[] {"LDU"}, 1, 1000 );

Vungle Issue

WRITE_EXTERNAL_STORAGE permission issue.
"WRITE_EXTERNAL_STORAGE" is a permission we recommend to apply for, but it is not required.
If there is any conflict with your application, you can choose to remove or modify in Androidmanifest.xml according to your project: Add line to remove permission:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18" tools:node="remove"/>

Add line to modify permission if you need:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:node="replace"/>

Yandex Metrica

Yandex App Metrics will be added along with Yandex Ads SDK.

Attention. You should take into account some features of the AppMetrica library during initialization. For more information, see Features of the AppMetrica library.

The code in the Application.onCreate() method runs for all processes. If you encounter an initialization error after integrating a third-party library (such as Clever Ads Solutions), make sure that the third-party library is initialized only in the main process. For more information, see Error descriptions.


What’s Next?