Skip to main content

InterstitialAd

import { InterstitialAd } from 'nitro-ui-admob'

A full-screen ad shown at natural transition points. Each loaded ad can be shown once, within one hour of loading. Guide: full-screen ads.

MemberDescription
load(adUnitId, options?)Loads an ad.
expiresAtWhen the ad expires.
show()Presents the ad once.
CallbacksonAdShown, onAdDismissed, onAdFailedToShow, onAdImpression, onAdClicked, onAdPaid.

load​

static load(adUnitId: string, options?: AdmobRequestOptions): Promise<InterstitialAd>

Loads an ad, starting the SDK if needed. options is an AdmobRequestOptions. Rejects with "<code>: <message>" from the SDK.

The class has no public constructor; load is the only way to get an instance.

expiresAt​

readonly expiresAt: number

When the ad expires, in milliseconds since the Unix epoch: one hour after loading.

show​

show(): void

Presents the ad over the current screen. Callbacks are cleared once it is dismissed or fails to show.

Throws if this ad was already shown or has expired.

Callbacks​

CallbackTypeCalled when
onAdShown() => voidThe ad starts covering the screen.
onAdDismissed() => voidThe user dismissed the ad.
onAdFailedToShow(error: AdmobError) => voidThe ad could not be presented.
onAdImpression() => voidThe SDK recorded an impression.
onAdClicked() => voidThe SDK recorded a click.
onAdPaid(value: AdmobAdValue) => voidWith the estimated revenue of the impression.

All are optional properties; assign them before show(). Types: AdmobError, AdmobAdValue.