Interstitial Ads
Interstitial ads are full-screen ads that cover the interface. Display them at natural pause points in your app, such as between game levels or after completing a task.
Each ad format uses a Zone ID to identify the ad placement. Zone IDs are configured in the Empower dashboard.
Note: All ad status listeners are optional. The SDK handles ad loading and display automatically. Use listeners only if you need to track ad states for analytics, UI updates, or custom logic.
Quick Start
import {
loadInterstitialAd,
showInterstitial,
addEventListener,
EmpowerAdsEvents,
AdStatus,
} from '@empower-nokta/react-native-mobile-ads';
const ZONE_ID = { android: 'ANDROID_ZONE_ID', ios: 'IOS_ZONE_ID' };
// Step 1: Preload the interstitial
loadInterstitialAd(ZONE_ID);
// Step 2: Listen for status (optional)
const unsubscribe = addEventListener(
EmpowerAdsEvents.INTERSTITIAL_STATUS,
(event) => {
if (event.status === AdStatus.READY) {
console.log('Interstitial ready to show');
}
}
);
// Step 3: Show at a natural break point
function onLevelComplete() {
showInterstitial(ZONE_ID);
}
Loading Interstitials
Load interstitial ads in advance so they're ready when needed:
import { loadInterstitialAd } from '@empower-nokta/react-native-mobile-ads';
// With a single zone ID
loadInterstitialAd('YOUR_ZONE_ID');
// With per-platform zone IDs
loadInterstitialAd({ android: 'ANDROID_ZONE_ID', ios: 'IOS_ZONE_ID' });
The function returns a Promise<boolean> that resolves to true when the ad starts loading.
Showing Interstitials
import { showInterstitial } from '@empower-nokta/react-native-mobile-ads';
function showInterstitialIfReady() {
showInterstitial('YOUR_ZONE_ID')
.then((shown) => {
if (!shown) {
console.log('Interstitial not ready yet');
}
})
.catch((err) => {
console.log('Failed to show interstitial:', err);
});
}
Listening to Interstitial Status (Optional)
import {
addEventListener,
EmpowerAdsEvents,
AdStatus,
loadInterstitialAd,
} from '@empower-nokta/react-native-mobile-ads';
const ZONE_ID = 'YOUR_ZONE_ID';
const unsubscribe = addEventListener(
EmpowerAdsEvents.INTERSTITIAL_STATUS,
(event) => {
switch (event.status) {
case AdStatus.READY:
// Ad is ready to be shown
break;
case AdStatus.FAILED:
// Ad failed to load — retry later
break;
case AdStatus.SHOWN:
// Ad is being displayed
break;
case AdStatus.SKIPPED:
// User dismissed the ad
break;
case AdStatus.USED:
// Ad was shown and closed — preload next
loadInterstitialAd(ZONE_ID);
break;
}
}
);
// Clean up when no longer needed
unsubscribe();
Complete Example
import React, { useEffect, useRef, useState } from 'react';
import { View, Button, Text } from 'react-native';
import {
loadInterstitialAd,
showInterstitial,
addEventListener,
EmpowerAdsEvents,
AdStatus,
} from '@empower-nokta/react-native-mobile-ads';
const ZONE_ID = { android: 'ANDROID_ZONE_ID', ios: 'IOS_ZONE_ID' };
export default function GameScreen() {
const level = useRef(1);
const [adReady, setAdReady] = useState(false);
useEffect(() => {
// Listen for interstitial status changes
const unsubInterstitial = addEventListener(
EmpowerAdsEvents.INTERSTITIAL_STATUS,
(event) => {
if (event.status === AdStatus.READY) {
setAdReady(true);
} else if (event.status === AdStatus.USED || event.status === AdStatus.FAILED) {
setAdReady(false);
// Reload for next time
loadInterstitialAd(ZONE_ID);
}
}
);
// Load the interstitial once the SDK is ready.
const unsubReady = addEventListener(
EmpowerAdsEvents.SDK_READY,
() => {
loadInterstitialAd(ZONE_ID);
unsubReady();
}
);
return () => {
unsubInterstitial();
unsubReady();
};
}, []);
const completeLevel = () => {
level.current += 1;
// Show interstitial every 3 levels
if (level.current % 3 === 0 && adReady) {
showInterstitial(ZONE_ID);
}
};
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text>Level {level.current}</Text>
<Button title="Complete Level" onPress={completeLevel} />
</View>
);
}
Best Practices
- Wait for SDK readiness — Load interstitial ads after the SDK is ready. Subscribe to the
SDK_READYevent and load once it fires. - Preload ads — Load ads before you need them for instant display
- Natural break points — Show ads at logical pauses (level complete, article end, screen transitions)
- Don't interrupt — Avoid showing during active gameplay or content consumption
- Reload after use — Load a new ad after each display using the
USEDstatus callback - Frequency capping — The SDK respects server-configured frequency caps
Ad Status Reference
| Status | Description |
|---|---|
INITIALIZING | Ad is loading |
READY | Ad is loaded and ready to display |
FAILED | Ad failed to load |
SHOWN | Ad is being displayed |
SKIPPED | User dismissed the ad |
USED | Ad was shown and closed |
WILL_LEAVE | User clicked the ad (leaving app) |