Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@capacitor-community/admob

Package Overview
Dependencies
Maintainers
31
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capacitor-community/admob - npm Package Compare versions

Comparing version 3.0.0-5 to 3.0.0-6

ios/Plugin/.DS_Store

1193

dist/docs.json

@@ -38,5 +38,724 @@ {

"slug": "initialize"
},
{
"name": "showBanner",
"signature": "(options: BannerAdOptions) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "AdOptions",
"type": "BannerAdOptions"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "group",
"text": "Banner"
},
{
"name": "param",
"text": "options AdOptions"
},
{
"name": "since",
"text": "1.1.2"
}
],
"docs": "Show a banner Ad",
"complexTypes": [
"BannerAdOptions"
],
"slug": "showbanner"
},
{
"name": "hideBanner",
"signature": "() => Promise<void>",
"parameters": [],
"returns": "Promise<void>",
"tags": [
{
"name": "group",
"text": "Banner"
},
{
"name": "since",
"text": "1.1.2"
}
],
"docs": "Hide the banner, remove it from screen, but can show it later",
"complexTypes": [],
"slug": "hidebanner"
},
{
"name": "resumeBanner",
"signature": "() => Promise<void>",
"parameters": [],
"returns": "Promise<void>",
"tags": [
{
"name": "group",
"text": "Banner"
},
{
"name": "since",
"text": "1.1.2"
}
],
"docs": "Resume the banner, show it after hide",
"complexTypes": [],
"slug": "resumebanner"
},
{
"name": "removeBanner",
"signature": "() => Promise<void>",
"parameters": [],
"returns": "Promise<void>",
"tags": [
{
"name": "group",
"text": "Banner"
},
{
"name": "since",
"text": "1.1.2"
}
],
"docs": "Destroy the banner, remove it from screen.",
"complexTypes": [],
"slug": "removebanner"
},
{
"name": "addListener",
"signature": "(eventName: BannerAdPluginEvents.SizeChanged, listenerFunc: (info: AdMobBannerSize) => void) => PluginListenerHandle",
"parameters": [
{
"name": "eventName",
"docs": "bannerAdSizeChanged",
"type": "BannerAdPluginEvents.SizeChanged"
},
{
"name": "listenerFunc",
"docs": "",
"type": "(info: AdMobBannerSize) => void"
}
],
"returns": "PluginListenerHandle",
"tags": [
{
"name": "group",
"text": "Banner"
},
{
"name": "param",
"text": "eventName bannerAdSizeChanged"
},
{
"name": "param",
"text": "listenerFunc"
},
{
"name": "since",
"text": "3.0.0"
}
],
"docs": "",
"complexTypes": [
"PluginListenerHandle",
"BannerAdPluginEvents",
"AdMobBannerSize"
],
"slug": "addlistenerbanneradplugineventssizechanged-"
},
{
"name": "addListener",
"signature": "(eventName: BannerAdPluginEvents.Loaded, listenerFunc: () => void) => PluginListenerHandle",
"parameters": [
{
"name": "eventName",
"docs": "bannerAdLoaded",
"type": "BannerAdPluginEvents.Loaded"
},
{
"name": "listenerFunc",
"docs": "",
"type": "() => void"
}
],
"returns": "PluginListenerHandle",
"tags": [
{
"name": "group",
"text": "Banner"
},
{
"name": "param",
"text": "eventName bannerAdLoaded"
},
{
"name": "param",
"text": "listenerFunc"
},
{
"name": "since",
"text": "3.0.0"
}
],
"docs": "Notice: request loaded Banner ad",
"complexTypes": [
"PluginListenerHandle",
"BannerAdPluginEvents"
],
"slug": "addlistenerbanneradplugineventsloaded-"
},
{
"name": "addListener",
"signature": "(eventName: BannerAdPluginEvents.FailedToLoad, listenerFunc: (info: AdMobError) => void) => PluginListenerHandle",
"parameters": [
{
"name": "eventName",
"docs": "bannerAdFailedToLoad",
"type": "BannerAdPluginEvents.FailedToLoad"
},
{
"name": "listenerFunc",
"docs": "",
"type": "(info: AdMobError) => void"
}
],
"returns": "PluginListenerHandle",
"tags": [
{
"name": "group",
"text": "Banner"
},
{
"name": "param",
"text": "eventName bannerAdFailedToLoad"
},
{
"name": "param",
"text": "listenerFunc"
},
{
"name": "since",
"text": "3.0.0"
}
],
"docs": "Notice: request failed Banner ad",
"complexTypes": [
"PluginListenerHandle",
"BannerAdPluginEvents",
"AdMobError"
],
"slug": "addlistenerbanneradplugineventsfailedtoload-"
},
{
"name": "addListener",
"signature": "(eventName: BannerAdPluginEvents.Opened, listenerFunc: () => void) => PluginListenerHandle",
"parameters": [
{
"name": "eventName",
"docs": "bannerAdOpened",
"type": "BannerAdPluginEvents.Opened"
},
{
"name": "listenerFunc",
"docs": "",
"type": "() => void"
}
],
"returns": "PluginListenerHandle",
"tags": [
{
"name": "group",
"text": "Banner"
},
{
"name": "param",
"text": "eventName bannerAdOpened"
},
{
"name": "param",
"text": "listenerFunc"
},
{
"name": "since",
"text": "3.0.0"
}
],
"docs": "Notice: full-screen banner view will be presented in response to the user clicking on an ad.",
"complexTypes": [
"PluginListenerHandle",
"BannerAdPluginEvents"
],
"slug": "addlistenerbanneradplugineventsopened-"
},
{
"name": "addListener",
"signature": "(eventName: BannerAdPluginEvents.Closed, listenerFunc: () => void) => PluginListenerHandle",
"parameters": [
{
"name": "eventName",
"docs": "bannerAdClosed",
"type": "BannerAdPluginEvents.Closed"
},
{
"name": "listenerFunc",
"docs": "",
"type": "() => void"
}
],
"returns": "PluginListenerHandle",
"tags": [
{
"name": "group",
"text": "Banner"
},
{
"name": "param",
"text": "eventName bannerAdClosed"
},
{
"name": "param",
"text": "listenerFunc"
},
{
"name": "since",
"text": "3.0.0"
}
],
"docs": "Notice: The full-screen banner view will been dismissed.",
"complexTypes": [
"PluginListenerHandle",
"BannerAdPluginEvents"
],
"slug": "addlistenerbanneradplugineventsclosed-"
},
{
"name": "addListener",
"signature": "(eventName: BannerAdPluginEvents.AdImpression, listenerFunc: () => void) => PluginListenerHandle",
"parameters": [
{
"name": "eventName",
"docs": "AdImpression",
"type": "BannerAdPluginEvents.AdImpression"
},
{
"name": "listenerFunc",
"docs": "",
"type": "() => void"
}
],
"returns": "PluginListenerHandle",
"tags": [
{
"name": "group",
"text": "Banner"
},
{
"name": "param",
"text": "eventName AdImpression"
},
{
"name": "param",
"text": "listenerFunc"
},
{
"name": "since",
"text": "3.0.0"
}
],
"docs": "Unimplemented",
"complexTypes": [
"PluginListenerHandle",
"BannerAdPluginEvents"
],
"slug": "addlistenerbanneradplugineventsadimpression-"
},
{
"name": "prepareInterstitial",
"signature": "(options: AdOptions) => Promise<AdLoadInfo>",
"parameters": [
{
"name": "options",
"docs": "AdOptions",
"type": "AdOptions"
}
],
"returns": "Promise<AdLoadInfo>",
"tags": [
{
"name": "group",
"text": "Interstitial"
},
{
"name": "param",
"text": "options AdOptions"
},
{
"name": "since",
"text": "1.1.2"
}
],
"docs": "Prepare interstitial banner",
"complexTypes": [
"AdLoadInfo",
"AdOptions"
],
"slug": "prepareinterstitial"
},
{
"name": "showInterstitial",
"signature": "() => Promise<void>",
"parameters": [],
"returns": "Promise<void>",
"tags": [
{
"name": "group",
"text": "Interstitial"
},
{
"name": "since",
"text": "1.1.2"
}
],
"docs": "Show interstitial ad when it’s ready",
"complexTypes": [],
"slug": "showinterstitial"
},
{
"name": "addListener",
"signature": "(eventName: InterstitialAdPluginEvents.FailedToLoad, listenerFunc: (error: AdMobError) => void) => PluginListenerHandle",
"parameters": [
{
"name": "eventName",
"docs": "",
"type": "InterstitialAdPluginEvents.FailedToLoad"
},
{
"name": "listenerFunc",
"docs": "",
"type": "(error: AdMobError) => void"
}
],
"returns": "PluginListenerHandle",
"tags": [],
"docs": "",
"complexTypes": [
"PluginListenerHandle",
"InterstitialAdPluginEvents",
"AdMobError"
],
"slug": "addlistenerinterstitialadplugineventsfailedtoload-"
},
{
"name": "addListener",
"signature": "(eventName: InterstitialAdPluginEvents.Loaded, listenerFunc: (info: AdLoadInfo) => void) => PluginListenerHandle",
"parameters": [
{
"name": "eventName",
"docs": "",
"type": "InterstitialAdPluginEvents.Loaded"
},
{
"name": "listenerFunc",
"docs": "",
"type": "(info: AdLoadInfo) => void"
}
],
"returns": "PluginListenerHandle",
"tags": [],
"docs": "",
"complexTypes": [
"PluginListenerHandle",
"InterstitialAdPluginEvents",
"AdLoadInfo"
],
"slug": "addlistenerinterstitialadplugineventsloaded-"
},
{
"name": "addListener",
"signature": "(eventName: InterstitialAdPluginEvents.Dismissed, listenerFunc: () => void) => PluginListenerHandle",
"parameters": [
{
"name": "eventName",
"docs": "",
"type": "InterstitialAdPluginEvents.Dismissed"
},
{
"name": "listenerFunc",
"docs": "",
"type": "() => void"
}
],
"returns": "PluginListenerHandle",
"tags": [],
"docs": "",
"complexTypes": [
"PluginListenerHandle",
"InterstitialAdPluginEvents"
],
"slug": "addlistenerinterstitialadplugineventsdismissed-"
},
{
"name": "addListener",
"signature": "(eventName: InterstitialAdPluginEvents.FailedToShow, listenerFunc: (error: AdMobError) => void) => PluginListenerHandle",
"parameters": [
{
"name": "eventName",
"docs": "",
"type": "InterstitialAdPluginEvents.FailedToShow"
},
{
"name": "listenerFunc",
"docs": "",
"type": "(error: AdMobError) => void"
}
],
"returns": "PluginListenerHandle",
"tags": [],
"docs": "",
"complexTypes": [
"PluginListenerHandle",
"InterstitialAdPluginEvents",
"AdMobError"
],
"slug": "addlistenerinterstitialadplugineventsfailedtoshow-"
},
{
"name": "addListener",
"signature": "(eventName: InterstitialAdPluginEvents.Showed, listenerFunc: () => void) => PluginListenerHandle",
"parameters": [
{
"name": "eventName",
"docs": "",
"type": "InterstitialAdPluginEvents.Showed"
},
{
"name": "listenerFunc",
"docs": "",
"type": "() => void"
}
],
"returns": "PluginListenerHandle",
"tags": [],
"docs": "",
"complexTypes": [
"PluginListenerHandle",
"InterstitialAdPluginEvents"
],
"slug": "addlistenerinterstitialadplugineventsshowed-"
},
{
"name": "prepareRewardVideoAd",
"signature": "(options: AdOptions) => Promise<AdLoadInfo>",
"parameters": [
{
"name": "options",
"docs": "AdOptions",
"type": "AdOptions"
}
],
"returns": "Promise<AdLoadInfo>",
"tags": [
{
"name": "group",
"text": "RewardVideo"
},
{
"name": "param",
"text": "options AdOptions"
},
{
"name": "since",
"text": "1.1.2"
}
],
"docs": "Prepare a reward video ad",
"complexTypes": [
"AdLoadInfo",
"AdOptions"
],
"slug": "preparerewardvideoad"
},
{
"name": "showRewardVideoAd",
"signature": "() => Promise<AdMobRewardItem>",
"parameters": [],
"returns": "Promise<AdMobRewardItem>",
"tags": [
{
"name": "group",
"text": "RewardVideo"
},
{
"name": "since",
"text": "1.1.2"
}
],
"docs": "Show a reward video ad",
"complexTypes": [
"AdMobRewardItem"
],
"slug": "showrewardvideoad"
},
{
"name": "addListener",
"signature": "(eventName: RewardAdPluginEvents.FailedToLoad, listenerFunc: (error: AdMobError) => void) => PluginListenerHandle",
"parameters": [
{
"name": "eventName",
"docs": "",
"type": "RewardAdPluginEvents.FailedToLoad"
},
{
"name": "listenerFunc",
"docs": "",
"type": "(error: AdMobError) => void"
}
],
"returns": "PluginListenerHandle",
"tags": [],
"docs": "",
"complexTypes": [
"PluginListenerHandle",
"RewardAdPluginEvents",
"AdMobError"
],
"slug": "addlistenerrewardadplugineventsfailedtoload-"
},
{
"name": "addListener",
"signature": "(eventName: RewardAdPluginEvents.Loaded, listenerFunc: (info: AdLoadInfo) => void) => PluginListenerHandle",
"parameters": [
{
"name": "eventName",
"docs": "",
"type": "RewardAdPluginEvents.Loaded"
},
{
"name": "listenerFunc",
"docs": "",
"type": "(info: AdLoadInfo) => void"
}
],
"returns": "PluginListenerHandle",
"tags": [],
"docs": "",
"complexTypes": [
"PluginListenerHandle",
"RewardAdPluginEvents",
"AdLoadInfo"
],
"slug": "addlistenerrewardadplugineventsloaded-"
},
{
"name": "addListener",
"signature": "(eventName: RewardAdPluginEvents.Rewarded, listenerFunc: (reward: AdMobRewardItem) => void) => PluginListenerHandle",
"parameters": [
{
"name": "eventName",
"docs": "",
"type": "RewardAdPluginEvents.Rewarded"
},
{
"name": "listenerFunc",
"docs": "",
"type": "(reward: AdMobRewardItem) => void"
}
],
"returns": "PluginListenerHandle",
"tags": [],
"docs": "",
"complexTypes": [
"PluginListenerHandle",
"RewardAdPluginEvents",
"AdMobRewardItem"
],
"slug": "addlistenerrewardadplugineventsrewarded-"
},
{
"name": "addListener",
"signature": "(eventName: RewardAdPluginEvents.Dismissed, listenerFunc: () => void) => PluginListenerHandle",
"parameters": [
{
"name": "eventName",
"docs": "",
"type": "RewardAdPluginEvents.Dismissed"
},
{
"name": "listenerFunc",
"docs": "",
"type": "() => void"
}
],
"returns": "PluginListenerHandle",
"tags": [],
"docs": "",
"complexTypes": [
"PluginListenerHandle",
"RewardAdPluginEvents"
],
"slug": "addlistenerrewardadplugineventsdismissed-"
},
{
"name": "addListener",
"signature": "(eventName: RewardAdPluginEvents.FailedToShow, listenerFunc: (error: AdMobError) => void) => PluginListenerHandle",
"parameters": [
{
"name": "eventName",
"docs": "",
"type": "RewardAdPluginEvents.FailedToShow"
},
{
"name": "listenerFunc",
"docs": "",
"type": "(error: AdMobError) => void"
}
],
"returns": "PluginListenerHandle",
"tags": [],
"docs": "",
"complexTypes": [
"PluginListenerHandle",
"RewardAdPluginEvents",
"AdMobError"
],
"slug": "addlistenerrewardadplugineventsfailedtoshow-"
},
{
"name": "addListener",
"signature": "(eventName: RewardAdPluginEvents.Showed, listenerFunc: () => void) => PluginListenerHandle",
"parameters": [
{
"name": "eventName",
"docs": "",
"type": "RewardAdPluginEvents.Showed"
},
{
"name": "listenerFunc",
"docs": "",
"type": "() => void"
}
],
"returns": "PluginListenerHandle",
"tags": [],
"docs": "",
"complexTypes": [
"PluginListenerHandle",
"RewardAdPluginEvents"
],
"slug": "addlistenerrewardadplugineventsshowed-"
}
],
"properties": []
"properties": [],
"importObject": [
"BannerDefinitions",
"InterstitialDefinitions",
"RewardDefinitions",
"AdMobDefinitions",
"AdMobPlugin",
"AdMobInitializationOptions"
]
},

@@ -55,3 +774,3 @@ "interfaces": [

{
"text": "https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547037-requesttrackingauthorization?changes=latest_minor",
"text": "https ://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547037-requesttrackingauthorization?changes=latest_minor",
"name": "see"

@@ -72,3 +791,3 @@ },

{
"text": "https://developers.google.com/admob/android/test-ads#enable_test_devices",
"text": "https ://developers.google.com/admob/android/test-ads#enable_test_devices",
"name": "see"

@@ -89,3 +808,3 @@ },

{
"text": "AdMobInitializationOptions.testingDevices",
"text": "AdMobInitializationOptions.testingDevices *",
"name": "see"

@@ -106,6 +825,470 @@ },

}
],
"importObject": [
"BannerDefinitions",
"InterstitialDefinitions",
"RewardDefinitions",
"AdMobDefinitions",
"AdMobPlugin",
"AdMobInitializationOptions"
]
},
{
"name": "BannerAdOptions",
"slug": "banneradoptions",
"docs": "This interface extends AdOptions",
"tags": [],
"methods": [],
"properties": [
{
"name": "adSize",
"tags": [
{
"text": "ADAPTIVE_BANNER",
"name": "default"
},
{
"text": "3.0.0",
"name": "since"
}
],
"docs": "Banner Ad Size, defaults to ADAPTIVE_BANNER.\r\nIT can be: ADAPTIVE_BANNER, SMART_BANNER, BANNER,\r\nMEDIUM_RECTANGLE, FULL_BANNER, LEADERBOARD",
"complexTypes": [
"BannerAdSize"
],
"type": "BannerAdSize"
},
{
"name": "position",
"tags": [
{
"text": "TOP_CENTER",
"name": "default"
},
{
"text": "1.1.2",
"name": "since"
}
],
"docs": "Set Banner Ad position.\r\nTOP_CENTER or CENTER or BOTTOM_CENTER",
"complexTypes": [
"BannerAdPosition"
],
"type": "BannerAdPosition"
}
],
"importObject": [
"AdOptions",
"BannerAdPosition",
"BannerAdSize",
"BannerAdOptions"
]
},
{
"name": "PluginListenerHandle",
"slug": "pluginlistenerhandle",
"docs": "",
"tags": [],
"methods": [],
"properties": [
{
"name": "remove",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "() => Promise<void>"
}
],
"importObject": [
"PluginRegistry",
"CapacitorException",
"CapacitorGlobal",
"RegisterPlugin",
"PluginImplementations",
"Plugin",
"PermissionState",
"PluginListenerHandle",
"PluginResultData",
"PluginResultError",
"PluginCallback"
]
},
{
"name": "AdMobBannerSize",
"slug": "admobbannersize",
"docs": "When notice listener of OnAdLoaded, you can get banner size.",
"tags": [],
"methods": [],
"properties": [
{
"name": "width",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "number"
},
{
"name": "height",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "number"
}
],
"importObject": [
"AdMobBannerSize"
]
},
{
"name": "AdMobError",
"slug": "admoberror",
"docs": "For more information\r\nhttps://developers.google.com/android/reference/com/google/android/gms/ads/AdError",
"tags": [],
"methods": [],
"properties": [
{
"name": "code",
"tags": [],
"docs": "Gets the error's code.",
"complexTypes": [],
"type": "number"
},
{
"name": "message",
"tags": [],
"docs": "Gets the message describing the error.",
"complexTypes": [],
"type": "string"
}
],
"importObject": [
"AdMobError"
]
},
{
"name": "AdLoadInfo",
"slug": "adloadinfo",
"docs": "",
"tags": [],
"methods": [],
"properties": [
{
"name": "adUnitId",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "string"
}
],
"importObject": [
"AdLoadInfo"
]
},
{
"name": "AdOptions",
"slug": "adoptions",
"docs": "",
"tags": [],
"methods": [],
"properties": [
{
"name": "adId",
"tags": [
{
"text": "https ://support.google.com/admob/answer/7356431?hl=en",
"name": "see"
},
{
"text": "1.1.2",
"name": "since"
}
],
"docs": "The ad unit ID that you want to request",
"complexTypes": [],
"type": "string"
},
{
"name": "isTesting",
"tags": [
{
"text": "false",
"name": "default"
},
{
"text": "1.1.2",
"name": "since"
}
],
"docs": "You can use test mode of ad.",
"complexTypes": [],
"type": "boolean | undefined"
},
{
"name": "margin",
"tags": [
{
"text": "0",
"name": "default"
},
{
"text": "1.1.2",
"name": "since"
}
],
"docs": "Margin Banner. Default is 0px;\r\nIf position is BOTTOM_CENTER, margin is be margin-bottom.\r\nIf position is TOP_CENTER, margin is be margin-top.",
"complexTypes": [],
"type": "number | undefined"
},
{
"name": "npa",
"tags": [
{
"text": "https ://developers.google.com/admob/ios/eu-consent",
"name": "see"
},
{
"text": "https ://developers.google.com/admob/android/eu-consent",
"name": "see"
},
{
"text": "false",
"name": "default"
},
{
"text": "1.2.0",
"name": "since"
}
],
"docs": "The default behavior of the Google Mobile Ads SDK is to serve personalized ads.\r\nSet this to true to request Non-Personalized Ads",
"complexTypes": [],
"type": "boolean | undefined"
}
],
"importObject": [
"AdOptions"
]
},
{
"name": "AdMobRewardItem",
"slug": "admobrewarditem",
"docs": "For more information\r\nhttps://developers.google.com/admob/android/rewarded-video-adapters?hl=en",
"tags": [],
"methods": [],
"properties": [
{
"name": "type",
"tags": [],
"docs": "Rewarded type user got",
"complexTypes": [],
"type": "string"
},
{
"name": "amount",
"tags": [],
"docs": "Rewarded amount user got",
"complexTypes": [],
"type": "number"
}
],
"importObject": [
"AdMobRewardItem"
]
}
],
"enums": []
"enums": [
{
"name": "BannerAdSize",
"slug": "banneradsize",
"members": [
{
"name": "BANNER",
"value": "'BANNER'",
"tags": [],
"docs": "Mobile Marketing Association (MMA)\r\nbanner ad size (320x50 density-independent pixels)."
},
{
"name": "FULL_BANNER",
"value": "'FULL_BANNER'",
"tags": [],
"docs": "Interactive Advertising Bureau (IAB)\r\nfull banner ad size (468x60 density-independent pixels)."
},
{
"name": "LARGE_BANNER",
"value": "'LARGE_BANNER'",
"tags": [],
"docs": "Large banner ad size (320x100 density-independent pixels)."
},
{
"name": "LEADERBOARD",
"value": "'LEADERBOARD'",
"tags": [],
"docs": "Interactive Advertising Bureau (IAB)\r\nleaderboard ad size (728x90 density-independent pixels)."
},
{
"name": "MEDIUM_RECTANGLE",
"value": "'MEDIUM_RECTANGLE'",
"tags": [],
"docs": "Interactive Advertising Bureau (IAB)\r\nmedium rectangle ad size (300x250 density-independent pixels)."
},
{
"name": "ADAPTIVE_BANNER",
"value": "'ADAPTIVE_BANNER'",
"tags": [],
"docs": "A dynamically sized banner that is full-width and auto-height."
},
{
"name": "SMART_BANNER",
"value": "'SMART_BANNER'",
"tags": [],
"docs": "Screen width x 32|50|90"
}
]
},
{
"name": "BannerAdPosition",
"slug": "banneradposition",
"members": [
{
"name": "TOP_CENTER",
"value": "'TOP_CENTER'",
"tags": [],
"docs": "Banner position be top-center"
},
{
"name": "CENTER",
"value": "'CENTER'",
"tags": [],
"docs": "Banner position be center"
},
{
"name": "BOTTOM_CENTER",
"value": "'BOTTOM_CENTER'",
"tags": [],
"docs": "Banner position be bottom-center(default)"
}
]
},
{
"name": "BannerAdPluginEvents",
"slug": "banneradpluginevents",
"members": [
{
"name": "SizeChanged",
"value": "\"bannerAdSizeChanged\"",
"tags": [],
"docs": ""
},
{
"name": "Loaded",
"value": "\"bannerAdLoaded\"",
"tags": [],
"docs": ""
},
{
"name": "FailedToLoad",
"value": "\"bannerAdFailedToLoad\"",
"tags": [],
"docs": ""
},
{
"name": "Opened",
"value": "\"bannerAdOpened\"",
"tags": [],
"docs": "Open \"Adsense\" Event after user click banner"
},
{
"name": "Closed",
"value": "\"bannerAdClosed\"",
"tags": [],
"docs": "Close \"Adsense\" Event after user click banner"
},
{
"name": "AdImpression",
"value": "\"bannerAdImpression\"",
"tags": [],
"docs": "Similarly, this method should be called when an impression is recorded for the ad by the mediated SDK."
}
]
},
{
"name": "InterstitialAdPluginEvents",
"slug": "interstitialadpluginevents",
"members": [
{
"name": "Loaded",
"value": "'interstitialAdLoaded'",
"tags": [],
"docs": "Emits after trying to prepare and Interstitial, when it is loaded and ready to be show"
},
{
"name": "FailedToLoad",
"value": "'interstitialAdFailedToLoad'",
"tags": [],
"docs": "Emits after trying to prepare and Interstitial, when it could not be loaded"
},
{
"name": "Showed",
"value": "'interstitialAdShowed'",
"tags": [],
"docs": "Emits when the Interstitial ad is visible to the user"
},
{
"name": "FailedToShow",
"value": "'interstitialAdFailedToShow'",
"tags": [],
"docs": "Emits when the Interstitial ad is failed to show"
},
{
"name": "Dismissed",
"value": "'interstitialAdDismissed'",
"tags": [],
"docs": "Emits when the Interstitial ad is not visible to the user anymore."
}
]
},
{
"name": "RewardAdPluginEvents",
"slug": "rewardadpluginevents",
"members": [
{
"name": "Loaded",
"value": "'onRewardedVideoAdLoaded'",
"tags": [],
"docs": "Emits after trying to prepare a RewardAd and the Video is loaded and ready to be show"
},
{
"name": "FailedToLoad",
"value": "'onRewardedVideoAdFailedToLoad'",
"tags": [],
"docs": "Emits after trying to prepare a RewardAd when it could not be loaded"
},
{
"name": "Showed",
"value": "'onRewardedVideoAdShowed'",
"tags": [],
"docs": "Emits when the AdReward video is visible to the user"
},
{
"name": "FailedToShow",
"value": "'onRewardedVideoAdFailedToShow'",
"tags": [],
"docs": "Emits when the AdReward video is failed to show"
},
{
"name": "Dismissed",
"value": "'onRewardedVideoAdDismissed'",
"tags": [],
"docs": "Emits when the AdReward video is not visible to the user anymore.\r\n\r\n**Important**: This has nothing to do with the reward it self. This event\r\nwill emits in this two cases:\r\n1. The user starts the video ad but close it before the reward emit.\r\n2. The user start the video and see it until end, then gets the reward\r\nand after that the ad is closed."
},
{
"name": "Rewarded",
"value": "'onRewardedVideoAdReward'",
"tags": [],
"docs": "Emits when user get rewarded from AdReward"
}
]
}
],
"typeAliases": [],
"pluginConfigs": []
}

15

dist/esm/banner/banner-ad-options.interface.d.ts

@@ -1,12 +0,15 @@

import type { AdOptions } from '../shared/ad-options.interface';
import type { AdOptions } from '../shared';
import type { BannerAdPosition } from './banner-ad-position.enum';
import type { BannerAdSize } from './banner-ad-size.enum';
/**
* This interface extends AdOptions
*/
export interface BannerAdOptions extends AdOptions {
/**
* Banner Ad Size, defaults to SMART_BANNER.
* IT can be: SMART_BANNER, BANNER, MEDIUM_RECTANGLE,
* FULL_BANNER, LEADERBOARD, SKYSCRAPER, or CUSTOM
* Banner Ad Size, defaults to ADAPTIVE_BANNER.
* IT can be: ADAPTIVE_BANNER, SMART_BANNER, BANNER,
* MEDIUM_RECTANGLE, FULL_BANNER, LEADERBOARD
*
* @default SMART_BANNER
* @since 1.1.2
* @default ADAPTIVE_BANNER
* @since 3.0.0
*/

@@ -13,0 +16,0 @@ adSize?: BannerAdSize;

@@ -6,5 +6,8 @@ export declare enum BannerAdPluginEvents {

/**
* Open or close "Adsense" Event after user click banner
* Open "Adsense" Event after user click banner
*/
Opened = "bannerAdOpened",
/**
* Close "Adsense" Event after user click banner
*/
Closed = "bannerAdClosed",

@@ -11,0 +14,0 @@ /**

@@ -8,5 +8,8 @@ // This enum should be keep in sync with their native equivalents with the same name

/**
* Open or close "Adsense" Event after user click banner
* Open "Adsense" Event after user click banner
*/
BannerAdPluginEvents["Opened"] = "bannerAdOpened";
/**
* Close "Adsense" Event after user click banner
*/
BannerAdPluginEvents["Closed"] = "bannerAdClosed";

@@ -13,0 +16,0 @@ /**

@@ -54,3 +54,3 @@ import type { PluginListenerHandle } from '@capacitor/core';

*/
addListener(eventName: BannerAdPluginEvents.Loaded, listenerFunc: (info: AdMobBannerSize) => void): PluginListenerHandle;
addListener(eventName: BannerAdPluginEvents.Loaded, listenerFunc: () => void): PluginListenerHandle;
/**

@@ -57,0 +57,0 @@ * Notice: request failed Banner ad

@@ -14,2 +14,5 @@ export declare enum InterstitialAdPluginEvents {

Showed = "interstitialAdShowed",
/**
* Emits when the Interstitial ad is failed to show
*/
FailedToShow = "interstitialAdFailedToShow",

@@ -16,0 +19,0 @@ /**

@@ -16,2 +16,5 @@ // This enum should be keep in sync with their native equivalents with the same name

InterstitialAdPluginEvents["Showed"] = "interstitialAdShowed";
/**
* Emits when the Interstitial ad is failed to show
*/
InterstitialAdPluginEvents["FailedToShow"] = "interstitialAdFailedToShow";

@@ -18,0 +21,0 @@ /**

import type { PluginListenerHandle } from '@capacitor/core';
import type { ValidateAllEventsEnumAreImplemented } from '../private/validate-all-events-implemented.type';
import type { AdLoadInfo, AdMobError } from '../shared';
import type { AdOptions } from '../shared/ad-options.interface';
import type { AdLoadInfo, AdMobError, AdOptions } from '../shared';
import type { InterstitialAdPluginEvents } from './interstitial-ad-plugin-events.enum';

@@ -6,0 +5,0 @@ export declare type InterstitialDefinitionsHasAllEvents = ValidateAllEventsEnumAreImplemented<InterstitialAdPluginEvents, InterstitialDefinitions>;

@@ -14,2 +14,5 @@ export declare enum RewardAdPluginEvents {

Showed = "onRewardedVideoAdShowed",
/**
* Emits when the AdReward video is failed to show
*/
FailedToShow = "onRewardedVideoAdFailedToShow",

@@ -26,3 +29,6 @@ /**

Dismissed = "onRewardedVideoAdDismissed",
/**
* Emits when user get rewarded from AdReward
*/
Rewarded = "onRewardedVideoAdReward"
}

@@ -16,2 +16,5 @@ // This enum should be keep in sync with their native equivalents with the same name

RewardAdPluginEvents["Showed"] = "onRewardedVideoAdShowed";
/**
* Emits when the AdReward video is failed to show
*/
RewardAdPluginEvents["FailedToShow"] = "onRewardedVideoAdFailedToShow";

@@ -28,4 +31,7 @@ /**

RewardAdPluginEvents["Dismissed"] = "onRewardedVideoAdDismissed";
/**
* Emits when user get rewarded from AdReward
*/
RewardAdPluginEvents["Rewarded"] = "onRewardedVideoAdReward";
})(RewardAdPluginEvents || (RewardAdPluginEvents = {}));
//# sourceMappingURL=reward-ad-plugin-events.enum.js.map
import type { PluginListenerHandle } from '@capacitor/core';
import type { ValidateAllEventsEnumAreImplemented } from '../private/validate-all-events-implemented.type';
import type { AdLoadInfo, AdMobError } from '../shared';
import type { AdOptions } from '../shared/ad-options.interface';
import type { AdLoadInfo, AdMobError, AdOptions } from '../shared';
import type { RewardAdPluginEvents } from './reward-ad-plugin-events.enum';

@@ -6,0 +5,0 @@ import type { AdMobRewardItem } from './reward-item.interface';

@@ -14,5 +14,8 @@ 'use strict';

/**
* Open or close "Adsense" Event after user click banner
* Open "Adsense" Event after user click banner
*/
BannerAdPluginEvents["Opened"] = "bannerAdOpened";
/**
* Close "Adsense" Event after user click banner
*/
BannerAdPluginEvents["Closed"] = "bannerAdClosed";

@@ -101,2 +104,5 @@ /**

InterstitialAdPluginEvents["Showed"] = "interstitialAdShowed";
/**
* Emits when the Interstitial ad is failed to show
*/
InterstitialAdPluginEvents["FailedToShow"] = "interstitialAdFailedToShow";

@@ -124,2 +130,5 @@ /**

RewardAdPluginEvents["Showed"] = "onRewardedVideoAdShowed";
/**
* Emits when the AdReward video is failed to show
*/
RewardAdPluginEvents["FailedToShow"] = "onRewardedVideoAdFailedToShow";

@@ -136,2 +145,5 @@ /**

RewardAdPluginEvents["Dismissed"] = "onRewardedVideoAdDismissed";
/**
* Emits when user get rewarded from AdReward
*/
RewardAdPluginEvents["Rewarded"] = "onRewardedVideoAdReward";

@@ -138,0 +150,0 @@ })(exports.RewardAdPluginEvents || (exports.RewardAdPluginEvents = {}));

@@ -11,5 +11,8 @@ var AdMobPlugin = (function (exports, core) {

/**
* Open or close "Adsense" Event after user click banner
* Open "Adsense" Event after user click banner
*/
BannerAdPluginEvents["Opened"] = "bannerAdOpened";
/**
* Close "Adsense" Event after user click banner
*/
BannerAdPluginEvents["Closed"] = "bannerAdClosed";

@@ -98,2 +101,5 @@ /**

InterstitialAdPluginEvents["Showed"] = "interstitialAdShowed";
/**
* Emits when the Interstitial ad is failed to show
*/
InterstitialAdPluginEvents["FailedToShow"] = "interstitialAdFailedToShow";

@@ -121,2 +127,5 @@ /**

RewardAdPluginEvents["Showed"] = "onRewardedVideoAdShowed";
/**
* Emits when the AdReward video is failed to show
*/
RewardAdPluginEvents["FailedToShow"] = "onRewardedVideoAdFailedToShow";

@@ -133,2 +142,5 @@ /**

RewardAdPluginEvents["Dismissed"] = "onRewardedVideoAdDismissed";
/**
* Emits when user get rewarded from AdReward
*/
RewardAdPluginEvents["Rewarded"] = "onRewardedVideoAdReward";

@@ -135,0 +147,0 @@ })(exports.RewardAdPluginEvents || (exports.RewardAdPluginEvents = {}));

{
"name": "@capacitor-community/admob",
"version": "3.0.0-5",
"version": "3.0.0-6",
"description": "A native plugin for AdMob",

@@ -27,3 +27,3 @@ "main": "dist/plugin.cjs.js",

"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
"verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin && cd ..",
"verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -sdk iphoneos && cd ..",
"verify:android": "cd android && ./gradlew clean build test && cd ..",

@@ -44,6 +44,6 @@ "verify:web": "npm run build",

"devDependencies": {
"@capacitor/android": "^3.0.0-rc.0",
"@capacitor/cli": "^3.0.0-rc.0",
"@capacitor/docgen": "^0.0.10",
"@capacitor/ios": "^3.0.0-rc.0",
"@capacitor/android": "^3.0.0-rc.2",
"@capacitor/cli": "^3.0.0-rc.2",
"@capacitor/docgen": "git+https://github.com/rdlabo/capacitor-docgen.git#feat/support_extends_build",
"@capacitor/ios": "^3.0.0-rc.2",
"@ionic/eslint-config": "^0.3.0",

@@ -62,3 +62,3 @@ "@ionic/prettier-config": "^1.0.1",

"dependencies": {
"@capacitor/core": "3.0.0-rc.0"
"@capacitor/core": "3.0.0-rc.2"
},

@@ -65,0 +65,0 @@ "prettier": "@ionic/prettier-config",

@@ -25,2 +25,3 @@ <p align="center"><br><img src="https://user-images.githubusercontent.com/236501/85893648-1c92e880-b7a8-11ea-926d-95355b8175c7.png" width="128" height="128" /></p>

| Masahiko Sakakibara | [rdlabo](https://github.com/rdlabo) | [@rdlabo](https://twitter.com/rdlabo) | RELATION DESIGN LABO, GENERAL INC. ASSOCIATION |
| Saninn Salas Diaz | [Saninn Salas Diaz](https://github.com/distante) | [@SaninnSalas](https://twitter.com/SaninnSalas) | |

@@ -47,3 +48,3 @@ Maintenance Status: Actively Maintained

## Android configuration
### Android configuration

@@ -78,3 +79,3 @@ In file `android/app/src/main/java/**/**/MainActivity.java`, add the plugin to the initialization list:

## iOS configuration
### iOS configuration

@@ -86,6 +87,11 @@ Add the following in the `ios/App/App/info.plist` file inside of the outermost `<dict>`:

<true/>
<key>GADApplicationIdentifier</key>
<string>[APP_ID]</string>
<key>SKAdNetworkItems</key>
<array>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>cstr6suwn9.skadnetwork</string>
</dict>
</array>
<key>NSUserTrackingUsageDescription</key>

@@ -97,6 +103,16 @@ <string>[Why you use NSUserTracking. ex: This identifier will be used to deliver personalized ads to you.]</string>

## Initialize
## Example
### Initialize AdMob
```ts
initialize(options: { requestTrackingAuthorization?: boolean , testingDevices?: string[]}): Promise<{ value: boolean }>
import { AdMob } from '@capacitor-community/admob';
export async function initialize(): Promise<void> {
AdMob.initialize({
requestTrackingAuthorization: true,
testingDevices: ['2077ef9a63d2b398840261c8221a0c9b'],
initializeForTesting: true,
});
}
```

@@ -111,149 +127,71 @@

## APIs
### BANNER
### Show Banner
#### Angular
```ts
import { AdMob, AdOptions, AdSize, AdPosition } from '@capacitor-community/admob';
import { AdMob, BannerAdOptions, BannerAdSize, BannerAdPosition, BannerAdPluginEvents, AdMobBannerSize } from '@capacitor-community/admob';
@Component({
selector: 'admob',
templateUrl: 'admob.component.html',
styleUrls: ['admob.component.scss'],
})
export class AdMobComponent {
private options: AdOptions = {
adId: 'YOUR ADID',
adSize: AdSize.BANNER,
position: AdPosition.BOTTOM_CENTER,
margin: 0,
// isTesting: true
// npa: true
};
constructor() {
// Subscribe Banner Event Listener
AdMob.addListener('bannerViewDidReceiveAd', (info: boolean) => {
console.log('Banner Ad Loaded');
export async function banner(): Promise<void> {
AdMob.addListener(BannerAdPluginEvents.Loaded, () => {
// Subscribe Banner Event Listener
});
// Get Banner Size
AdMob.addListener('bannerViewChangeSize', (info: boolean) => {
console.log(info);
AdMob.addListener(BannerAdPluginEvents.SizeChanged, (size: AdMobBannerSize) => {
// Subscribe Change Banner Size
});
// Show Banner Ad
AdMob.showBanner(this.options);
}
const options: BannerAdOptions = {
adId: 'YOUR ADID',
adSize: BannerAdSize.BANNER,
position: BannerAdPosition.BOTTOM_CENTER,
margin: 0,
// isTesting: true
// npa: true
};
AdMob.showBanner(options);
}
```
#### React
This is implements simple sample from https://github.com/DavidFrahm . Thanks!
### Show Interstitial
```ts
import React from 'react';
import { Redirect, Route } from 'react-router-dom';
import { IonApp, IonRouterOutlet, isPlatform } from '@ionic/react';
import { IonReactRouter } from '@ionic/react-router';
import Home from './pages/Home';
import { AdMob, AdOptions, AdLoadInfo, InterstitialAdPluginEvents } from '@capacitor-community/admob';
import { AdMob, AdOptions, AdSize, AdPosition } from '@capacitor-community/admob';
export async function interstitial(): Promise<void> {
AdMob.addListener(InterstitialAdPluginEvents.Loaded, (info: AdLoadInfo) => {
// Subscribe prepared interstitial
});
const App: React.FC = () => {
AdMob.initialize();
const adId = {
ios: 'ios-value-here',
android: 'android-value-here',
};
const platformAdId = isPlatform('android') ? adId.android : adId.ios;
const options: AdOptions = {
adId: platformAdId,
adSize: AdSize.BANNER,
position: AdPosition.BOTTOM_CENTER,
margin: 0,
adId: 'YOUR ADID',
// isTesting: true
// npa: true
};
AdMob.showBanner(options);
// Subscribe Banner Event Listener
AdMob.addListener('bannerViewDidReceiveAd', (info: boolean) => {
console.log('Banner ad loaded');
});
// Get Banner Size
AdMob.addListener('bannerViewChangeSize', (info: boolean) => {
console.log(info);
});
return (
<IonApp>
<IonReactRouter>
<IonRouterOutlet>
<Route path="/home" component={Home} exact={true} />
<Route exact path="/" render={() => <Redirect to="/home" />} />
</IonRouterOutlet>
</IonReactRouter>
</IonApp>
);
};
export default App;
await AdMob.prepareInterstitial(options);
await AdMob.showInterstitial();
}
```
### INTERSTITIAL
### Show RewardVideo
```ts
import { AdMob, AdOptions } from '@capacitor-community/admob';
import { AdMob, AdOptions, AdLoadInfo, RewardAdPluginEvents, AdMobRewardItem } from '@capacitor-community/admob';
@Component({
selector: 'admob',
templateUrl: 'admob.component.html',
styleUrls: ['admob.component.scss'],
})
export class AppComponent {
options: AdOptions = {
adId: 'YOUR ADID',
};
export async function rewardVideo(): Promise<void> {
AdMob.addListener(RewardAdPluginEvents.Loaded, (info: AdLoadInfo) => {
// Subscribe prepared rewardVideo
});
constructor() {
// Subscribe interstitial Event Listener
AdMob.addListener('adDidPresentFullScreenContent', (info: boolean) => {
AdMob.showInterstitial();
});
AdMob.addListener(RewardAdPluginEvents.Rewarded, (rewardItem: AdMobRewardItem) => {
// Subscribe user rewarded
console.log(rewardItem);
});
// Prepare interstitial banner
AdMob.prepareInterstitial(this.options);
}
}
```
### RewardVideo
```ts
import { AdMob, AdOptions } from '@capacitor-community/admob';
@Component({
selector: 'admob',
templateUrl: 'admob.component.html',
styleUrls: ['admob.component.scss'],
})
export class AdMobComponent {
options: AdOptions = {
const options: AdOptions = {
adId: 'YOUR ADID',
// isTesting: true
// npa: true
};
constructor() {
AdMob.addListener('adDidPresentFullScreenContent', () => {
AdMob.showRewardVideoAd();
});
AdMob.prepareRewardVideoAd(this.options);
}
await AdMob.prepareRewardVideoAd(options);
const rewardItem = await AdMob.showRewardVideoAd();
}

@@ -266,3 +204,29 @@ ```

* [`initialize(...)`](#initialize)
* [`showBanner(...)`](#showbanner)
* [`hideBanner()`](#hidebanner)
* [`resumeBanner()`](#resumebanner)
* [`removeBanner()`](#removebanner)
* [`addListener(BannerAdPluginEvents.SizeChanged, ...)`](#addlistenerbanneradplugineventssizechanged-)
* [`addListener(BannerAdPluginEvents.Loaded, ...)`](#addlistenerbanneradplugineventsloaded-)
* [`addListener(BannerAdPluginEvents.FailedToLoad, ...)`](#addlistenerbanneradplugineventsfailedtoload-)
* [`addListener(BannerAdPluginEvents.Opened, ...)`](#addlistenerbanneradplugineventsopened-)
* [`addListener(BannerAdPluginEvents.Closed, ...)`](#addlistenerbanneradplugineventsclosed-)
* [`addListener(BannerAdPluginEvents.AdImpression, ...)`](#addlistenerbanneradplugineventsadimpression-)
* [`prepareInterstitial(...)`](#prepareinterstitial)
* [`showInterstitial()`](#showinterstitial)
* [`addListener(InterstitialAdPluginEvents.FailedToLoad, ...)`](#addlistenerinterstitialadplugineventsfailedtoload-)
* [`addListener(InterstitialAdPluginEvents.Loaded, ...)`](#addlistenerinterstitialadplugineventsloaded-)
* [`addListener(InterstitialAdPluginEvents.Dismissed, ...)`](#addlistenerinterstitialadplugineventsdismissed-)
* [`addListener(InterstitialAdPluginEvents.FailedToShow, ...)`](#addlistenerinterstitialadplugineventsfailedtoshow-)
* [`addListener(InterstitialAdPluginEvents.Showed, ...)`](#addlistenerinterstitialadplugineventsshowed-)
* [`prepareRewardVideoAd(...)`](#preparerewardvideoad)
* [`showRewardVideoAd()`](#showrewardvideoad)
* [`addListener(RewardAdPluginEvents.FailedToLoad, ...)`](#addlistenerrewardadplugineventsfailedtoload-)
* [`addListener(RewardAdPluginEvents.Loaded, ...)`](#addlistenerrewardadplugineventsloaded-)
* [`addListener(RewardAdPluginEvents.Rewarded, ...)`](#addlistenerrewardadplugineventsrewarded-)
* [`addListener(RewardAdPluginEvents.Dismissed, ...)`](#addlistenerrewardadplugineventsdismissed-)
* [`addListener(RewardAdPluginEvents.FailedToShow, ...)`](#addlistenerrewardadplugineventsfailedtoshow-)
* [`addListener(RewardAdPluginEvents.Showed, ...)`](#addlistenerrewardadplugineventsshowed-)
* [Interfaces](#interfaces)
* [Enums](#enums)

@@ -292,2 +256,418 @@ </docgen-index>

### showBanner(...)
```typescript
showBanner(options: BannerAdOptions) => Promise<void>
```
Show a banner Ad
| Param | Type | Description |
| ------------- | ----------------------------------------------------------- | ---------------------------------- |
| **`options`** | <code><a href="#banneradoptions">BannerAdOptions</a></code> | <a href="#adoptions">AdOptions</a> |
**Since:** 1.1.2
--------------------
### hideBanner()
```typescript
hideBanner() => Promise<void>
```
Hide the banner, remove it from screen, but can show it later
**Since:** 1.1.2
--------------------
### resumeBanner()
```typescript
resumeBanner() => Promise<void>
```
Resume the banner, show it after hide
**Since:** 1.1.2
--------------------
### removeBanner()
```typescript
removeBanner() => Promise<void>
```
Destroy the banner, remove it from screen.
**Since:** 1.1.2
--------------------
### addListener(BannerAdPluginEvents.SizeChanged, ...)
```typescript
addListener(eventName: BannerAdPluginEvents.SizeChanged, listenerFunc: (info: AdMobBannerSize) => void) => PluginListenerHandle
```
| Param | Type | Description |
| ------------------ | --------------------------------------------------------------------------------- | ------------------- |
| **`eventName`** | <code><a href="#banneradpluginevents">BannerAdPluginEvents.SizeChanged</a></code> | bannerAdSizeChanged |
| **`listenerFunc`** | <code>(info: <a href="#admobbannersize">AdMobBannerSize</a>) =&gt; void</code> | |
**Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
**Since:** 3.0.0
--------------------
### addListener(BannerAdPluginEvents.Loaded, ...)
```typescript
addListener(eventName: BannerAdPluginEvents.Loaded, listenerFunc: () => void) => PluginListenerHandle
```
Notice: request loaded Banner ad
| Param | Type | Description |
| ------------------ | ---------------------------------------------------------------------------- | -------------- |
| **`eventName`** | <code><a href="#banneradpluginevents">BannerAdPluginEvents.Loaded</a></code> | bannerAdLoaded |
| **`listenerFunc`** | <code>() =&gt; void</code> | |
**Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
**Since:** 3.0.0
--------------------
### addListener(BannerAdPluginEvents.FailedToLoad, ...)
```typescript
addListener(eventName: BannerAdPluginEvents.FailedToLoad, listenerFunc: (info: AdMobError) => void) => PluginListenerHandle
```
Notice: request failed Banner ad
| Param | Type | Description |
| ------------------ | ---------------------------------------------------------------------------------- | -------------------- |
| **`eventName`** | <code><a href="#banneradpluginevents">BannerAdPluginEvents.FailedToLoad</a></code> | bannerAdFailedToLoad |
| **`listenerFunc`** | <code>(info: <a href="#admoberror">AdMobError</a>) =&gt; void</code> | |
**Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
**Since:** 3.0.0
--------------------
### addListener(BannerAdPluginEvents.Opened, ...)
```typescript
addListener(eventName: BannerAdPluginEvents.Opened, listenerFunc: () => void) => PluginListenerHandle
```
Notice: full-screen banner view will be presented in response to the user clicking on an ad.
| Param | Type | Description |
| ------------------ | ---------------------------------------------------------------------------- | -------------- |
| **`eventName`** | <code><a href="#banneradpluginevents">BannerAdPluginEvents.Opened</a></code> | bannerAdOpened |
| **`listenerFunc`** | <code>() =&gt; void</code> | |
**Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
**Since:** 3.0.0
--------------------
### addListener(BannerAdPluginEvents.Closed, ...)
```typescript
addListener(eventName: BannerAdPluginEvents.Closed, listenerFunc: () => void) => PluginListenerHandle
```
Notice: The full-screen banner view will been dismissed.
| Param | Type | Description |
| ------------------ | ---------------------------------------------------------------------------- | -------------- |
| **`eventName`** | <code><a href="#banneradpluginevents">BannerAdPluginEvents.Closed</a></code> | bannerAdClosed |
| **`listenerFunc`** | <code>() =&gt; void</code> | |
**Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
**Since:** 3.0.0
--------------------
### addListener(BannerAdPluginEvents.AdImpression, ...)
```typescript
addListener(eventName: BannerAdPluginEvents.AdImpression, listenerFunc: () => void) => PluginListenerHandle
```
Unimplemented
| Param | Type | Description |
| ------------------ | ---------------------------------------------------------------------------------- | ------------ |
| **`eventName`** | <code><a href="#banneradpluginevents">BannerAdPluginEvents.AdImpression</a></code> | AdImpression |
| **`listenerFunc`** | <code>() =&gt; void</code> | |
**Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
**Since:** 3.0.0
--------------------
### prepareInterstitial(...)
```typescript
prepareInterstitial(options: AdOptions) => Promise<AdLoadInfo>
```
Prepare interstitial banner
| Param | Type | Description |
| ------------- | ----------------------------------------------- | ---------------------------------- |
| **`options`** | <code><a href="#adoptions">AdOptions</a></code> | <a href="#adoptions">AdOptions</a> |
**Returns:** <code>Promise&lt;<a href="#adloadinfo">AdLoadInfo</a>&gt;</code>
**Since:** 1.1.2
--------------------
### showInterstitial()
```typescript
showInterstitial() => Promise<void>
```
Show interstitial ad when it’s ready
**Since:** 1.1.2
--------------------
### addListener(InterstitialAdPluginEvents.FailedToLoad, ...)
```typescript
addListener(eventName: InterstitialAdPluginEvents.FailedToLoad, listenerFunc: (error: AdMobError) => void) => PluginListenerHandle
```
| Param | Type |
| ------------------ | ---------------------------------------------------------------------------------------------- |
| **`eventName`** | <code><a href="#interstitialadpluginevents">InterstitialAdPluginEvents.FailedToLoad</a></code> |
| **`listenerFunc`** | <code>(error: <a href="#admoberror">AdMobError</a>) =&gt; void</code> |
**Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
--------------------
### addListener(InterstitialAdPluginEvents.Loaded, ...)
```typescript
addListener(eventName: InterstitialAdPluginEvents.Loaded, listenerFunc: (info: AdLoadInfo) => void) => PluginListenerHandle
```
| Param | Type |
| ------------------ | ---------------------------------------------------------------------------------------- |
| **`eventName`** | <code><a href="#interstitialadpluginevents">InterstitialAdPluginEvents.Loaded</a></code> |
| **`listenerFunc`** | <code>(info: <a href="#adloadinfo">AdLoadInfo</a>) =&gt; void</code> |
**Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
--------------------
### addListener(InterstitialAdPluginEvents.Dismissed, ...)
```typescript
addListener(eventName: InterstitialAdPluginEvents.Dismissed, listenerFunc: () => void) => PluginListenerHandle
```
| Param | Type |
| ------------------ | ------------------------------------------------------------------------------------------- |
| **`eventName`** | <code><a href="#interstitialadpluginevents">InterstitialAdPluginEvents.Dismissed</a></code> |
| **`listenerFunc`** | <code>() =&gt; void</code> |
**Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
--------------------
### addListener(InterstitialAdPluginEvents.FailedToShow, ...)
```typescript
addListener(eventName: InterstitialAdPluginEvents.FailedToShow, listenerFunc: (error: AdMobError) => void) => PluginListenerHandle
```
| Param | Type |
| ------------------ | ---------------------------------------------------------------------------------------------- |
| **`eventName`** | <code><a href="#interstitialadpluginevents">InterstitialAdPluginEvents.FailedToShow</a></code> |
| **`listenerFunc`** | <code>(error: <a href="#admoberror">AdMobError</a>) =&gt; void</code> |
**Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
--------------------
### addListener(InterstitialAdPluginEvents.Showed, ...)
```typescript
addListener(eventName: InterstitialAdPluginEvents.Showed, listenerFunc: () => void) => PluginListenerHandle
```
| Param | Type |
| ------------------ | ---------------------------------------------------------------------------------------- |
| **`eventName`** | <code><a href="#interstitialadpluginevents">InterstitialAdPluginEvents.Showed</a></code> |
| **`listenerFunc`** | <code>() =&gt; void</code> |
**Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
--------------------
### prepareRewardVideoAd(...)
```typescript
prepareRewardVideoAd(options: AdOptions) => Promise<AdLoadInfo>
```
Prepare a reward video ad
| Param | Type | Description |
| ------------- | ----------------------------------------------- | ---------------------------------- |
| **`options`** | <code><a href="#adoptions">AdOptions</a></code> | <a href="#adoptions">AdOptions</a> |
**Returns:** <code>Promise&lt;<a href="#adloadinfo">AdLoadInfo</a>&gt;</code>
**Since:** 1.1.2
--------------------
### showRewardVideoAd()
```typescript
showRewardVideoAd() => Promise<AdMobRewardItem>
```
Show a reward video ad
**Returns:** <code>Promise&lt;<a href="#admobrewarditem">AdMobRewardItem</a>&gt;</code>
**Since:** 1.1.2
--------------------
### addListener(RewardAdPluginEvents.FailedToLoad, ...)
```typescript
addListener(eventName: RewardAdPluginEvents.FailedToLoad, listenerFunc: (error: AdMobError) => void) => PluginListenerHandle
```
| Param | Type |
| ------------------ | ---------------------------------------------------------------------------------- |
| **`eventName`** | <code><a href="#rewardadpluginevents">RewardAdPluginEvents.FailedToLoad</a></code> |
| **`listenerFunc`** | <code>(error: <a href="#admoberror">AdMobError</a>) =&gt; void</code> |
**Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
--------------------
### addListener(RewardAdPluginEvents.Loaded, ...)
```typescript
addListener(eventName: RewardAdPluginEvents.Loaded, listenerFunc: (info: AdLoadInfo) => void) => PluginListenerHandle
```
| Param | Type |
| ------------------ | ---------------------------------------------------------------------------- |
| **`eventName`** | <code><a href="#rewardadpluginevents">RewardAdPluginEvents.Loaded</a></code> |
| **`listenerFunc`** | <code>(info: <a href="#adloadinfo">AdLoadInfo</a>) =&gt; void</code> |
**Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
--------------------
### addListener(RewardAdPluginEvents.Rewarded, ...)
```typescript
addListener(eventName: RewardAdPluginEvents.Rewarded, listenerFunc: (reward: AdMobRewardItem) => void) => PluginListenerHandle
```
| Param | Type |
| ------------------ | -------------------------------------------------------------------------------- |
| **`eventName`** | <code><a href="#rewardadpluginevents">RewardAdPluginEvents.Rewarded</a></code> |
| **`listenerFunc`** | <code>(reward: <a href="#admobrewarditem">AdMobRewardItem</a>) =&gt; void</code> |
**Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
--------------------
### addListener(RewardAdPluginEvents.Dismissed, ...)
```typescript
addListener(eventName: RewardAdPluginEvents.Dismissed, listenerFunc: () => void) => PluginListenerHandle
```
| Param | Type |
| ------------------ | ------------------------------------------------------------------------------- |
| **`eventName`** | <code><a href="#rewardadpluginevents">RewardAdPluginEvents.Dismissed</a></code> |
| **`listenerFunc`** | <code>() =&gt; void</code> |
**Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
--------------------
### addListener(RewardAdPluginEvents.FailedToShow, ...)
```typescript
addListener(eventName: RewardAdPluginEvents.FailedToShow, listenerFunc: (error: AdMobError) => void) => PluginListenerHandle
```
| Param | Type |
| ------------------ | ---------------------------------------------------------------------------------- |
| **`eventName`** | <code><a href="#rewardadpluginevents">RewardAdPluginEvents.FailedToShow</a></code> |
| **`listenerFunc`** | <code>(error: <a href="#admoberror">AdMobError</a>) =&gt; void</code> |
**Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
--------------------
### addListener(RewardAdPluginEvents.Showed, ...)
```typescript
addListener(eventName: RewardAdPluginEvents.Showed, listenerFunc: () => void) => PluginListenerHandle
```
| Param | Type |
| ------------------ | ---------------------------------------------------------------------------- |
| **`eventName`** | <code><a href="#rewardadpluginevents">RewardAdPluginEvents.Showed</a></code> |
| **`listenerFunc`** | <code>() =&gt; void</code> |
**Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
--------------------
### Interfaces

@@ -304,2 +684,128 @@

#### BannerAdOptions
This interface extends <a href="#adoptions">AdOptions</a>
| Prop | Type | Description | Default | Since |
| -------------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- | ----- |
| **`adSize`** | <code><a href="#banneradsize">BannerAdSize</a></code> | Banner Ad Size, defaults to ADAPTIVE_BANNER. IT can be: ADAPTIVE_BANNER, SMART_BANNER, BANNER, MEDIUM_RECTANGLE, FULL_BANNER, LEADERBOARD | <code>ADAPTIVE_BANNER</code> | 3.0.0 |
| **`position`** | <code><a href="#banneradposition">BannerAdPosition</a></code> | Set Banner Ad position. TOP_CENTER or CENTER or BOTTOM_CENTER | <code>TOP_CENTER</code> | 1.1.2 |
#### PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |
#### AdMobBannerSize
When notice listener of OnAdLoaded, you can get banner size.
| Prop | Type |
| ------------ | ------------------- |
| **`width`** | <code>number</code> |
| **`height`** | <code>number</code> |
#### AdMobError
For more information
https://developers.google.com/android/reference/com/google/android/gms/ads/AdError
| Prop | Type | Description |
| ------------- | ------------------- | -------------------------------------- |
| **`code`** | <code>number</code> | Gets the error's code. |
| **`message`** | <code>string</code> | Gets the message describing the error. |
#### AdLoadInfo
| Prop | Type |
| -------------- | ------------------- |
| **`adUnitId`** | <code>string</code> |
#### AdOptions
| Prop | Type | Description | Default | Since |
| --------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ----- |
| **`adId`** | <code>string</code> | The ad unit ID that you want to request | | 1.1.2 |
| **`isTesting`** | <code>boolean</code> | You can use test mode of ad. | <code>false</code> | 1.1.2 |
| **`margin`** | <code>number</code> | Margin Banner. Default is 0px; If position is BOTTOM_CENTER, margin is be margin-bottom. If position is TOP_CENTER, margin is be margin-top. | <code>0</code> | 1.1.2 |
| **`npa`** | <code>boolean</code> | The default behavior of the Google Mobile Ads SDK is to serve personalized ads. Set this to true to request Non-Personalized Ads | <code>false</code> | 1.2.0 |
#### AdMobRewardItem
For more information
https://developers.google.com/admob/android/rewarded-video-adapters?hl=en
| Prop | Type | Description |
| ------------ | ------------------- | ------------------------ |
| **`type`** | <code>string</code> | Rewarded type user got |
| **`amount`** | <code>number</code> | Rewarded amount user got |
### Enums
#### BannerAdSize
| Members | Value | Description |
| ---------------------- | ------------------------------- | --------------------------------------------------------------------------------------------------- |
| **`BANNER`** | <code>'BANNER'</code> | Mobile Marketing Association (MMA) banner ad size (320x50 density-independent pixels). |
| **`FULL_BANNER`** | <code>'FULL_BANNER'</code> | Interactive Advertising Bureau (IAB) full banner ad size (468x60 density-independent pixels). |
| **`LARGE_BANNER`** | <code>'LARGE_BANNER'</code> | Large banner ad size (320x100 density-independent pixels). |
| **`LEADERBOARD`** | <code>'LEADERBOARD'</code> | Interactive Advertising Bureau (IAB) leaderboard ad size (728x90 density-independent pixels). |
| **`MEDIUM_RECTANGLE`** | <code>'MEDIUM_RECTANGLE'</code> | Interactive Advertising Bureau (IAB) medium rectangle ad size (300x250 density-independent pixels). |
| **`ADAPTIVE_BANNER`** | <code>'ADAPTIVE_BANNER'</code> | A dynamically sized banner that is full-width and auto-height. |
| **`SMART_BANNER`** | <code>'SMART_BANNER'</code> | Screen width x 32\|50\|90 |
#### BannerAdPosition
| Members | Value | Description |
| ------------------- | ---------------------------- | ----------------------------------------- |
| **`TOP_CENTER`** | <code>'TOP_CENTER'</code> | Banner position be top-center |
| **`CENTER`** | <code>'CENTER'</code> | Banner position be center |
| **`BOTTOM_CENTER`** | <code>'BOTTOM_CENTER'</code> | Banner position be bottom-center(default) |
#### BannerAdPluginEvents
| Members | Value | Description |
| ------------------ | ----------------------------------- | ------------------------------------------------------------------------------------------------------ |
| **`SizeChanged`** | <code>"bannerAdSizeChanged"</code> | |
| **`Loaded`** | <code>"bannerAdLoaded"</code> | |
| **`FailedToLoad`** | <code>"bannerAdFailedToLoad"</code> | |
| **`Opened`** | <code>"bannerAdOpened"</code> | Open "Adsense" Event after user click banner |
| **`Closed`** | <code>"bannerAdClosed"</code> | Close "Adsense" Event after user click banner |
| **`AdImpression`** | <code>"bannerAdImpression"</code> | Similarly, this method should be called when an impression is recorded for the ad by the mediated SDK. |
#### InterstitialAdPluginEvents
| Members | Value | Description |
| ------------------ | ----------------------------------------- | -------------------------------------------------------------------------------------- |
| **`Loaded`** | <code>'interstitialAdLoaded'</code> | Emits after trying to prepare and Interstitial, when it is loaded and ready to be show |
| **`FailedToLoad`** | <code>'interstitialAdFailedToLoad'</code> | Emits after trying to prepare and Interstitial, when it could not be loaded |
| **`Showed`** | <code>'interstitialAdShowed'</code> | Emits when the Interstitial ad is visible to the user |
| **`FailedToShow`** | <code>'interstitialAdFailedToShow'</code> | Emits when the Interstitial ad is failed to show |
| **`Dismissed`** | <code>'interstitialAdDismissed'</code> | Emits when the Interstitial ad is not visible to the user anymore. |
#### RewardAdPluginEvents
| Members | Value | Description |
| ------------------ | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **`Loaded`** | <code>'onRewardedVideoAdLoaded'</code> | Emits after trying to prepare a RewardAd and the Video is loaded and ready to be show |
| **`FailedToLoad`** | <code>'onRewardedVideoAdFailedToLoad'</code> | Emits after trying to prepare a RewardAd when it could not be loaded |
| **`Showed`** | <code>'onRewardedVideoAdShowed'</code> | Emits when the AdReward video is visible to the user |
| **`FailedToShow`** | <code>'onRewardedVideoAdFailedToShow'</code> | Emits when the AdReward video is failed to show |
| **`Dismissed`** | <code>'onRewardedVideoAdDismissed'</code> | Emits when the AdReward video is not visible to the user anymore. **Important**: This has nothing to do with the reward it self. This event will emits in this two cases: 1. The user starts the video ad but close it before the reward emit. 2. The user start the video and see it until end, then gets the reward and after that the ad is closed. |
| **`Rewarded`** | <code>'onRewardedVideoAdReward'</code> | Emits when user get rewarded from AdReward |
</docgen-api>

@@ -306,0 +812,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc