Skip to main content

AppOpenAd

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

A full-screen ad shown when the app comes to the foreground. Each loaded ad can be shown once, within four hours of loading. Most apps use startAppOpenAds instead of this class directly. Guide: app open ads.

MemberDescription
load(adUnitId, options?)Loads an ad.
expiresAtWhen the ad expires, four hours after loading.
show()Presents the ad once; throws if shown or expired.
CallbacksonAdShown, onAdDismissed, onAdFailedToShow, onAdImpression, onAdClicked, onAdPaid.

load​

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

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

expiresAt​

readonly expiresAt: number

When the ad expires, in milliseconds since the Unix epoch: four hours after loading.

show() and the callbacks behave as on InterstitialAd.