Types
import type {
AdmobAdValue,
AdmobRequestConfiguration,
AdmobRequestOptions,
BannerAdSize,
} from 'nitro-ui-admob'
| Type | Kind | Used by |
|---|---|---|
AdmobRequestConfiguration | Interface | Admob.setRequestConfiguration |
AdmobMaxAdContentRating | Union | AdmobRequestConfiguration |
AdmobAgeRestrictedTreatment | Union | AdmobRequestConfiguration |
AdmobPersonalization | Union | AdmobRequestConfiguration |
AdmobRequestOptions | Interface | load(), BannerAd, startAppOpenAds |
AdmobFormat | Union | Admob.testAdUnitId |
AdmobAdValue | Interface | onAdPaid |
AdmobAdValuePrecision | Union | AdmobAdValue |
AdmobReward | Interface | Rewarded formats |
AdmobServerSideVerificationOptions | Interface | setServerSideVerificationOptions |
AdmobListenerSubscription | Interface | Admob.addOnAppForegroundListener |
BannerAdSize | Union | BannerAd |
BannerAdDimensions | Interface | BannerAd events |
AdmobError | Interface | Error callbacks |
BannerAdProps | Interface | BannerAd |
AppOpenAdsOptions | Interface | startAppOpenAds |
BannerAdView | Class | The native view behind BannerAd |
AdmobRequestConfiguration
Settings applied to every ad request. Omitted fields use SDK defaults.
| Field | Type | Description |
|---|---|---|
testDeviceIds | string[] | Devices that receive test ads. Each ID is logged by the SDK on its first ad request. Simulators and emulators always receive test ads. |
maxAdContentRating | AdmobMaxAdContentRating | The highest content rating of ads to serve. |
ageRestrictedTreatment | AdmobAgeRestrictedTreatment | The age treatment of ad requests. Defaults to unspecified. |
personalization | AdmobPersonalization | Whether 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.
| Field | Type | Description |
|---|---|---|
keywords | string[] | Keywords describing the app content, such as sports. |
contentUrl | string | The URL of the content shown next to the ad. |
neighboringContentUrls | string[] | 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.
| Field | Type | Description |
|---|---|---|
valueMicros | number | The value in millionths of currencyCode. |
currencyCode | string | The ISO 4217 currency code, such as USD. |
precision | AdmobAdValuePrecision | How exact the value is. |
AdmobAdValuePrecision
type AdmobAdValuePrecision = 'unknown' | 'estimated' | 'publisherProvided' | 'precise'
AdmobReward
The reward a rewarded ad grants, as configured in the AdMob UI.
| Field | Type | Description |
|---|---|---|
type | string | The reward type, such as coins. |
amount | number | The reward amount. |
AdmobServerSideVerificationOptions
Data AdMob forwards to your server-side verification callback when the user earns a reward.
| Field | Type | Description |
|---|---|---|
userId | string | Your identifier of the user. |
customData | string | Any data to pass to your server. |
AdmobListenerSubscription
A registered listener.
| Field | Type | Description |
|---|---|---|
remove | () => void | Unregisters the listener. |
BannerAdSize
type BannerAdSize =
'anchoredAdaptive' | 'banner' | 'largeBanner' | 'mediumRectangle' | 'fullBanner' | 'leaderboard'
| Value | Size |
|---|---|
anchoredAdaptive | The full laid-out width, with a height chosen by the SDK. |
banner | 320 × 50 |
largeBanner | 320 × 100 |
mediumRectangle | 300 × 250 |
fullBanner | 468 × 60 |
leaderboard | 728 × 90 |
BannerAdDimensions
The size of a banner ad in points (iOS) or dp (Android).
| Field | Type |
|---|---|
width | number |
height | number |