Skip to main content

Configuration

This guide explains how to initialize and configure the Empower Mobile Ads SDK in your application.

SDK Initialization

Initialize the SDK after the consent flow completes, ideally from the consent callback. See Terms and Privacy Policy Flow.

Basic Initialization

EMAManager.init(
application = this,
appAdIdentifier = "YOUR_APP_AD_IDENTIFIER"
)
Important

Replace YOUR_APP_AD_IDENTIFIER with the app identifier provided by Empower.

Advanced Initialization with Configuration

For more control over the SDK behavior, use the EMAConfiguration builder:

val configuration = EMAConfiguration.Builder(
application = this,
appAdIdentifier = "YOUR_APP_AD_IDENTIFIER"
)
.debugMode(true)
.logLevel(LogLevel.DEFAULT)
.build()

EMAManager.init(configuration)
Testing with Empower

When sharing a test APK with us for verification, build it with .debugMode(true) and .logLevel(LogLevel.ALL) so we can inspect the SDK logs. Keep both disabled in production builds.

Log Levels

LevelDescription
ALLLogs all messages including debug information
DEFAULTLogs general information and errors
ERRORLogs errors only
WARNINGLogs warnings and errors only
NONEDisables all logging

Listening for SDK Ready State

If you need to know exactly when the SDK is ready (for analytics, UI updates, etc.), implement EMASdkReadyListener. Call setSdkReadyListener before init so the ready event is not missed:

class MyApplication : Application(), EMASdkReadyListener {
override fun onCreate() {
super.onCreate()
EMAManager.setSdkReadyListener(this)
EMAManager.init(this, "YOUR_APP_AD_IDENTIFIER")
}

override fun onReady() {
}

override fun onFailed(error: Throwable?) {
}
}
You do not need this listener

Ad load calls made right after init() are queued and run automatically once the SDK is ready. Use the listener only if you need the exact ready moment, for example for analytics or UI updates.

Disabling Ads at Runtime

If you need to temporarily stop serving ads without tearing down the SDK (e.g., a feature flag or a user toggle), set EMASettings.isAdsDisabled to true. The SDK stays initialized, so flipping it back to false resumes ads immediately. No re-initialization required.

// Stop serving ads without shutting down the SDK
EMASettings.isAdsDisabled = true

// Resume ads later
EMASettings.isAdsDisabled = false
tip

Use this for short-lived toggles. For permanent shutdown (e.g., user purchased premium and you want to release all SDK resources), use shutdown() below.

Shutdown

Use shutdown() when you no longer want to show ads (e.g., user bought premium):

EMAManager.shutdown()