Mediation

Initialize Mediation

The Mediation SDK is automatically initialized by the Chartboost Core SDK. Review the Core SDK documentation for more information.

Network Kill Switch πŸ”—

The network kill switch is a static method ChartboostMediationSdk.setPreinitializationConfiguration() that must be called before Core SDK initialization is initiated. This prevents specific partners from being initialized.

// Prepare a list of partners that should not be initialized
ChartboostMediationSdk.setPreinitializationConfiguration(
   ChartboostMediationPreinitializationConfiguration(
       YOUR_LIST_OF_PARTNER_IDS_TO_SKIP
   ),
)
Partner Identifier
AdMob admob
Amazon Publisher Services amazon_aps
AppLovin applovin
BidMachine bidmachine
Chartboost Monetization chartboost
Digital Turbine Exchange (Fyber) fyber
HyprMX hyprmx
Google Bidding google_googlebidding
InMobi inmobi
ironSource ironsource
Liftoff Monetize (Vungle) vungle
Meta Audience Network facebook
Mintegral mintegral
MobileFuse mobilefuse
Pangle pangle
Unity unity
Verve verve

A Consent Management Platform (CPM) is required and handled by the Core SDK. Review the Core SDK’s Consent Management Platform documentation to set up your CPM module. Once a CPM is chosen and setup, initialize the module.

// Create a usercentrics module (or any other consent management platform module)
val usercentrics = UsercentricsAdapter()

Module Listener πŸ”—

The module listener notifies when the specified module finishes initialization so additional action can follow. This module is optional.

// Create a module listener
val listener = object : ModuleObserver {
    override fun onModuleInitializationCompleted(result: ModuleInitializationResult) {
        // Use this to action off of a specific module initialization
        val moduleId = result.moduleId
    }

Initialize Chartboost Core πŸ”—

Initializing Chartboost Core only requires your Chartboost App ID which initializes Mediation.

To find your Chartboost app ID, log into your Chartboost platform, navigate to Apps Management, select your app, and the app ID will be listed on the right column under App information.

// Make sure you're in a coroutine
CoroutineScope(Main).launch {
    // Initialize ChartboostCore. You do not need to do anything additional besides providing the Chartboost app ID to initialize mediation.
    ChartboostCore.initializeSdk(context, SdkConfiguration("[chartboost app id]", listOf(usercentrics)), listener)