App Open Ads
App open ads appear when users bring your app to the foreground, providing a monetization opportunity during app launches.
Each ad format uses a Zone ID to identify the ad placement. Zone IDs are configured in the Empower dashboard.
Load the app open ad once at app startup and show it when the user brings your app back to the foreground.
Loading an App Open Ad
Load the ad at app startup:
- Kotlin
- Java
EMAManager.loadAppOpenAd(zoneId = "YOUR_APP_OPEN_ZONE_ID")
EMAManager.INSTANCE.loadAppOpenAd("YOUR_APP_OPEN_ZONE_ID");
Showing an App Open Ad
Show the ad when the app returns to the foreground, for example from a ProcessLifecycleOwner observer on ON_START, passing the current foreground Activity:
- Kotlin
- Java
EMAManager.showAppOpen(
zoneId = "YOUR_APP_OPEN_ZONE_ID",
activity = currentActivity
)
EMAManager.INSTANCE.showAppOpen("YOUR_APP_OPEN_ZONE_ID", currentActivity);
Listening to App Open Status
All ad status listeners are optional. The SDK loads and displays ads automatically, retries failed loads, and reloads the next ad after a show based on per-zone settings from the Empower dashboard. Do not build manual reload loops, for example calling loadAppOpenAd again from a completion callback. Use listeners only if you need to track ad states for analytics, UI updates.
| Status | Description |
|---|---|
READY | Ad is loaded and ready to display |
FAILED | Ad failed to load |
SHOWN | Ad is being displayed |
SKIPPED | User dismissed the ad |
If you need to track app open status:
- Kotlin
- Java
EMAManager.loadAppOpenAd(
zoneId = "YOUR_APP_OPEN_ZONE_ID",
listener = object : AdStatusListener {
override fun empowerAppOpenStatusChanged(adStatus: AdStatus) {
when (adStatus) {
AdStatus.READY -> { }
AdStatus.FAILED -> { }
AdStatus.SHOWN -> { }
else -> {}
}
}
}
)
EMAManager.INSTANCE.loadAppOpenAd("YOUR_APP_OPEN_ZONE_ID",
new AdStatusListener() {
@Override
public void empowerAppOpenStatusChanged(AdStatus adStatus) {
switch (adStatus) {
case READY:
break;
case FAILED:
break;
case SHOWN:
break;
}
}
}
);