Skip to main content

Types

import type {
AdmobAdValue,
AdmobRequestConfiguration,
AdmobRequestOptions,
BannerAdSize,
} from 'nitro-ui-admob'
TypeKindUsed by
AdmobRequestConfigurationInterfaceAdmob.setRequestConfiguration
AdmobMaxAdContentRatingUnionAdmobRequestConfiguration
AdmobAgeRestrictedTreatmentUnionAdmobRequestConfiguration
AdmobPersonalizationUnionAdmobRequestConfiguration
AdmobRequestOptionsInterfaceload(), BannerAd, startAppOpenAds
AdmobFormatUnionAdmob.testAdUnitId
AdmobAdValueInterfaceonAdPaid
AdmobAdValuePrecisionUnionAdmobAdValue
AdmobRewardInterfaceRewarded formats
AdmobServerSideVerificationOptionsInterfacesetServerSideVerificationOptions
AdmobListenerSubscriptionInterfaceAdmob.addOnAppForegroundListener
BannerAdSizeUnionBannerAd
BannerAdDimensionsInterfaceBannerAd events
AdmobErrorInterfaceError callbacks
BannerAdPropsInterfaceBannerAd
AppOpenAdsOptionsInterfacestartAppOpenAds
BannerAdViewClassThe native view behind BannerAd

AdmobRequestConfiguration​

Settings applied to every ad request. Omitted fields use SDK defaults.

FieldTypeDescription
testDeviceIdsstring[]Devices that receive test ads. Each ID is logged by the SDK on its first ad request. Simulators and emulators always receive test ads.
maxAdContentRatingAdmobMaxAdContentRatingThe highest content rating of ads to serve.
ageRestrictedTreatmentAdmobAgeRestrictedTreatmentThe age treatment of ad requests. Defaults to unspecified.
personalizationAdmobPersonalizationWhether ads may be personalized. Defaults to default.

AdmobMaxAdContentRating​

type AdmobMaxAdContentRating = 'general' | 'parentalGuidance' | 'teen' | 'matureAudience'

The highest content rating of ads to serve.

AdmobAgeRestrictedTreatment​

type AdmobAgeRestrictedTreatment = 'unspecified' | 'child' | 'teen'

child covers child-directed treatment (COPPA); teen covers users under the age of consent. Consult your legal counsel; setting it certifies that it is accurate.

AdmobPersonalization​

type AdmobPersonalization = 'default' | 'enabled' | 'disabled'

The publisher privacy treatment of ad requests. disabled requests non-personalized ads.

AdmobRequestOptions​

Targeting for a single ad request.

FieldTypeDescription
keywordsstring[]Keywords describing the app content, such as sports.
contentUrlstringThe URL of the content shown next to the ad.
neighboringContentUrlsstring[]URLs of other content in the app, for contextual targeting.

AdmobFormat​

type AdmobFormat = 'banner' | 'interstitial' | 'rewarded' | 'rewardedInterstitial' | 'appOpen'

An ad format with a Google sample ad unit, see Admob.testAdUnitId.

AdmobAdValue​

The estimated revenue of one ad impression.

FieldTypeDescription
valueMicrosnumberThe value in millionths of currencyCode.
currencyCodestringThe ISO 4217 currency code, such as USD.
precisionAdmobAdValuePrecisionHow exact the value is.

AdmobAdValuePrecision​

type AdmobAdValuePrecision = 'unknown' | 'estimated' | 'publisherProvided' | 'precise'

AdmobReward​

The reward a rewarded ad grants, as configured in the AdMob UI.

FieldTypeDescription
typestringThe reward type, such as coins.
amountnumberThe reward amount.

AdmobServerSideVerificationOptions​

Data AdMob forwards to your server-side verification callback when the user earns a reward.

FieldTypeDescription
userIdstringYour identifier of the user.
customDatastringAny data to pass to your server.

AdmobListenerSubscription​

A registered listener.

FieldTypeDescription
remove() => voidUnregisters the listener.

BannerAdSize​

type BannerAdSize =
'anchoredAdaptive' | 'banner' | 'largeBanner' | 'mediumRectangle' | 'fullBanner' | 'leaderboard'
ValueSize
anchoredAdaptiveThe full laid-out width, with a height chosen by the SDK.
banner320 × 50
largeBanner320 × 100
mediumRectangle300 × 250
fullBanner468 × 60
leaderboard728 × 90

BannerAdDimensions​

The size of a banner ad in points (iOS) or dp (Android).

FieldType
widthnumber
heightnumber