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 interstitialloadInterstitialAd(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 pointfunction 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 IDloadInterstitialAd('YOUR_ZONE_ID');// With per-platform zone IDsloadInterstitialAd({ 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 shownbreak;case AdStatus.FAILED:// Ad failed to load — retry laterbreak;case AdStatus.SHOWN:// Ad is being displayedbreak;case AdStatus.SKIPPED:// User dismissed the adbreak;case AdStatus.USED:// Ad was shown and closed — preload nextloadInterstitialAd(ZONE_ID);break;}});// Clean up when no longer neededunsubscribe();
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 changesconst 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 timeloadInterstitialAd(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 levelsif (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_STATUSevent 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
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) |