AdMob for
NitroUI apps
Banner, interstitial, rewarded, rewarded interstitial and app open ads on the Google Mobile Ads SDK 13 (iOS) and the GMA Next-Gen SDK (Android), with typed Swift and Kotlin implementations.
bun add nitro-ui-admobEvery AdMob format
One package for the five formats, plus the helpers Google recommends around them.
Full-screen ads
Load, show once, get typed events. Each ad expires one hour after loading.
Banner ads
A NitroUI view that sizes itself: adaptive to its width, or one of five fixed sizes.
App open ads
Shown on each return from the background, never on a cold start.
Always ready
Keeps one ad loaded, replaces it before it expires, retries with backoff.
Built for production
The details around the ads, handled in Swift and Kotlin and typed in TypeScript.
Request configuration
Test devices, max content rating, child and teen treatment, non-personalized ads.
Rewards and SSV
Reward callbacks and server-side verification options for both rewarded formats.
Revenue events
onAdPaid reports value in micros, currency code and precision for every format.
Expiry built in
expiresAt on every full-screen ad; show() throws once an ad is stale or used.
Typed errors
AdmobError carries the SDK code and message, from load, show and banner events.
No leaked callbacks
Callbacks are cleared after dismissal, so closures that capture the ad are freed.
App ID stays native
The SDK reads your AdMob app ID from Info.plist and AndroidManifest.xml.
Google test units
Admob.testAdUnitId returns the sample ad unit for each format and platform.
A small, typed API
Static loaders return native ad objects. Assign callbacks, call show() once, and let the helpers handle expiry and retries.
Read the guidesimport { Admob, BannerAd, InterstitialAd } from 'nitro-ui-admob'
Admob.setRequestConfiguration({ maxAdContentRating: 'teen' })
const ad = await InterstitialAd.load(Admob.testAdUnitId('interstitial'))
ad.onAdDismissed = () => console.log('dismissed')
ad.show()
function Footer() {
return <BannerAd adUnitId={Admob.testAdUnitId('banner')} />
}
Ship your first ad
Install the package, add your AdMob app ID to the native config, and show a test ad.