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);
}
}
);
// Wait for SDK to be ready before loading interstitial.
// Banner status event is a reliable signal that the SDK has
// finished parsing ad zones.
const unsubBanner = addEventListener(
EmpowerAdsEvents.BANNER_STATUS,
() => {
loadInterstitialAd(ZONE_ID);
unsubBanner();
}
);
return () => {
unsubInterstitial();
unsubBanner();
};
}, []);
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 has fully initialized. Listening for a BANNER_STATUS event is a reliable signal that ad zones are parsed and ready.
  • 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 USED status callback
  • Frequency capping — The SDK respects server-configured frequency caps

Ad Status Reference

StatusDescription
INITIALIZINGAd is loading
READYAd is loaded and ready to display
FAILEDAd failed to load
SHOWNAd is being displayed
SKIPPEDUser dismissed the ad
USEDAd was shown and closed
WILL_LEAVEUser clicked the ad (leaving app)