@capgo/capacitor-admob 8.1.21 → 8.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CapgoCapacitorAdmob.podspec +1 -0
- package/Package.swift +4 -2
- package/README.md +327 -8
- package/android/build.gradle +3 -2
- package/android/src/main/kotlin/admob/plus/capacitor/AdMobPlusPlugin.kt +121 -0
- package/android/src/main/kotlin/admob/plus/capacitor/ConsentHelper.kt +140 -0
- package/android/src/main/kotlin/admob/plus/capacitor/Generated.kt +7 -0
- package/android/src/main/kotlin/admob/plus/capacitor/feed/FeedAdManager.kt +512 -0
- package/android/src/main/kotlin/admob/plus/core/Ad.kt +2 -4
- package/android/src/main/kotlin/admob/plus/core/Helper.kt +18 -1
- package/dist/docs.json +543 -5
- package/dist/esm/definitions.d.ts +284 -1
- package/dist/esm/definitions.js +55 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/events.d.ts +127 -0
- package/dist/esm/events.js +50 -0
- package/dist/esm/events.js.map +1 -0
- package/dist/esm/feed-ad.d.ts +32 -0
- package/dist/esm/feed-ad.js +133 -0
- package/dist/esm/feed-ad.js.map +1 -0
- package/dist/esm/index.d.ts +4 -2
- package/dist/esm/index.js +4 -32
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/plugin-instance.d.ts +3 -0
- package/dist/esm/plugin-instance.js +35 -0
- package/dist/esm/plugin-instance.js.map +1 -0
- package/dist/esm/web.d.ts +11 -1
- package/dist/esm/web.js +40 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +313 -31
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +313 -31
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/AdmobPlusPlugin/AdmobPlusPlugin.swift +131 -1
- package/ios/Sources/AdmobPlusPlugin/BannerAd.swift +6 -9
- package/ios/Sources/AdmobPlusPlugin/ConsentExecutor.swift +100 -0
- package/ios/Sources/AdmobPlusPlugin/FeedAdManager.swift +435 -0
- package/ios/Sources/AdmobPlusPlugin/Generated.swift +7 -0
- package/ios/Sources/AdmobPlusPlugin/Helper.swift +29 -0
- package/ios/Sources/AdmobPlusPlugin/InterstitialAd.swift +7 -13
- package/ios/Sources/AdmobPlusPlugin/RewardedAd.swift +13 -20
- package/ios/Sources/AdmobPlusPlugin/RewardedInterstitialAd.swift +13 -20
- package/ios/Tests/AdmobPlusPluginTests/AdmobPlusPluginTests.swift +3 -6
- package/package.json +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PluginListenerHandle } from '@capacitor/core';
|
|
2
|
+
import type { AdMobPlusEventName, AdMobPlusEventPayloadMap } from './events';
|
|
2
3
|
/**
|
|
3
4
|
* Maximum ad content rating enum used to restrict ads based on content rating.
|
|
4
5
|
*
|
|
@@ -44,6 +45,93 @@ export type RequestConfig = {
|
|
|
44
45
|
/** Array of test device IDs */
|
|
45
46
|
testDeviceIds?: string[];
|
|
46
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* Consent status from Google's User Messaging Platform (UMP).
|
|
50
|
+
*
|
|
51
|
+
* @see https://developers.google.com/admob/ump/android/reference/com/google/android/ump/ConsentInformation.ConsentStatus
|
|
52
|
+
* @since 8.2.0
|
|
53
|
+
*/
|
|
54
|
+
export declare enum AdmobConsentStatus {
|
|
55
|
+
/** User consent not required. */
|
|
56
|
+
NOT_REQUIRED = "NOT_REQUIRED",
|
|
57
|
+
/** User consent already obtained. */
|
|
58
|
+
OBTAINED = "OBTAINED",
|
|
59
|
+
/** User consent required but not yet obtained. */
|
|
60
|
+
REQUIRED = "REQUIRED",
|
|
61
|
+
/** Unknown consent status. Call requestConsentInfo() to update it. */
|
|
62
|
+
UNKNOWN = "UNKNOWN"
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Privacy options requirement status from UMP.
|
|
66
|
+
*
|
|
67
|
+
* @see https://developers.google.com/admob/ump/android/reference/com/google/android/ump/ConsentInformation.PrivacyOptionsRequirementStatus
|
|
68
|
+
* @since 8.2.0
|
|
69
|
+
*/
|
|
70
|
+
export declare enum PrivacyOptionsRequirementStatus {
|
|
71
|
+
/** Privacy options entry point is not required. */
|
|
72
|
+
NOT_REQUIRED = "NOT_REQUIRED",
|
|
73
|
+
/** Privacy options entry point is required. */
|
|
74
|
+
REQUIRED = "REQUIRED",
|
|
75
|
+
/** Privacy options requirement status is unknown. */
|
|
76
|
+
UNKNOWN = "UNKNOWN"
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Debug geography for testing UMP consent flows locally.
|
|
80
|
+
*
|
|
81
|
+
* @see https://developers.google.com/admob/ump/android/reference/com/google/android/ump/ConsentDebugSettings.DebugGeography
|
|
82
|
+
* @since 8.2.0
|
|
83
|
+
*/
|
|
84
|
+
export declare enum AdmobConsentDebugGeography {
|
|
85
|
+
/** Debug geography disabled. */
|
|
86
|
+
DISABLED = 0,
|
|
87
|
+
/** Geography appears as in EEA for debug devices. */
|
|
88
|
+
EEA = 1,
|
|
89
|
+
/**
|
|
90
|
+
* Geography appears as not in EEA for debug devices.
|
|
91
|
+
*
|
|
92
|
+
* @deprecated Use OTHER instead.
|
|
93
|
+
*/
|
|
94
|
+
NOT_EEA = 2,
|
|
95
|
+
/** Geography appears as in a regulated US state for debug devices. */
|
|
96
|
+
US = 3,
|
|
97
|
+
/** Geography appears as OTHER for debug devices. */
|
|
98
|
+
OTHER = 4
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Options for requesting UMP consent information.
|
|
102
|
+
*
|
|
103
|
+
* @since 8.2.0
|
|
104
|
+
*/
|
|
105
|
+
export type AdmobConsentRequestOptions = {
|
|
106
|
+
/** Sets the debug geography to test consent locally. */
|
|
107
|
+
debugGeography?: AdmobConsentDebugGeography;
|
|
108
|
+
/**
|
|
109
|
+
* Test device IDs to allow for consent debugging.
|
|
110
|
+
* On iOS, the ID may change if you uninstall and reinstall the app.
|
|
111
|
+
*/
|
|
112
|
+
testDeviceIdentifiers?: string[];
|
|
113
|
+
/**
|
|
114
|
+
* When true, tags the user as under the age of consent for UMP requests.
|
|
115
|
+
*
|
|
116
|
+
* @default false
|
|
117
|
+
*/
|
|
118
|
+
tagForUnderAgeOfConsent?: boolean;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Consent information returned by UMP.
|
|
122
|
+
*
|
|
123
|
+
* @since 8.2.0
|
|
124
|
+
*/
|
|
125
|
+
export type AdmobConsentInfo = {
|
|
126
|
+
/** The consent status of the user. */
|
|
127
|
+
status: AdmobConsentStatus;
|
|
128
|
+
/** If true, a consent form is available. */
|
|
129
|
+
isConsentFormAvailable?: boolean;
|
|
130
|
+
/** If true, an ad request can be made. */
|
|
131
|
+
canRequestAds: boolean;
|
|
132
|
+
/** Privacy options requirement status of the user. */
|
|
133
|
+
privacyOptionsRequirementStatus: PrivacyOptionsRequirementStatus;
|
|
134
|
+
};
|
|
47
135
|
/**
|
|
48
136
|
* Tracking authorization status for iOS App Tracking Transparency.
|
|
49
137
|
*
|
|
@@ -101,6 +189,89 @@ export type RewardedInterstitialAdOptions = MobileAdOptions & {
|
|
|
101
189
|
/** Server-side verification options sent with rewarded callbacks. */
|
|
102
190
|
serverSideVerification?: ServerSideVerificationOptions;
|
|
103
191
|
};
|
|
192
|
+
/**
|
|
193
|
+
* In-feed ad format. Both use a native overlay aligned to an HTML placeholder.
|
|
194
|
+
*
|
|
195
|
+
* @since 8.3.0
|
|
196
|
+
*/
|
|
197
|
+
export type FeedAdFormat = 'native' | 'banner';
|
|
198
|
+
/**
|
|
199
|
+
* Optional colors for the built-in native ad template (hex strings, e.g. `#ffffff`).
|
|
200
|
+
*
|
|
201
|
+
* @since 8.3.0
|
|
202
|
+
*/
|
|
203
|
+
export type FeedNativeAdStyle = {
|
|
204
|
+
backgroundColor?: string;
|
|
205
|
+
headlineTextColor?: string;
|
|
206
|
+
bodyTextColor?: string;
|
|
207
|
+
ctaBackgroundColor?: string;
|
|
208
|
+
ctaTextColor?: string;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Options for creating an in-feed ad instance.
|
|
212
|
+
*
|
|
213
|
+
* Policy: AdMob counts native impressions and clicks only when assets render inside
|
|
214
|
+
* {@link https://developers.google.com/admob/android/native/advanced | NativeAdView} /
|
|
215
|
+
* GADNativeAdView with the AdChoices icon and an ad attribution badge. This plugin
|
|
216
|
+
* overlays a compliant native view on your placeholder. Optional {@link FeedNativeAdAssets}
|
|
217
|
+
* are returned on `feed.load` for layout sizing only, not for manual click forwarding.
|
|
218
|
+
*
|
|
219
|
+
* @since 8.3.0
|
|
220
|
+
*/
|
|
221
|
+
export type FeedAdCreateOptions = {
|
|
222
|
+
/** Native advanced or inline banner. */
|
|
223
|
+
format: FeedAdFormat;
|
|
224
|
+
/** AdMob ad unit ID. */
|
|
225
|
+
adUnitId: string;
|
|
226
|
+
/** Optional key echoed on feed events for your feed slot. */
|
|
227
|
+
positionKey?: string;
|
|
228
|
+
/**
|
|
229
|
+
* Auto-refresh interval in milliseconds. AdMob requires at least 30 seconds.
|
|
230
|
+
* Omit or pass `null` to disable auto-refresh.
|
|
231
|
+
*/
|
|
232
|
+
autoRefreshMs?: number | null;
|
|
233
|
+
/** Template colors when `format` is `native`. */
|
|
234
|
+
nativeStyle?: FeedNativeAdStyle;
|
|
235
|
+
};
|
|
236
|
+
/**
|
|
237
|
+
* Normalized native ad assets for placeholder sizing. Clicks and impressions stay on the native view.
|
|
238
|
+
*
|
|
239
|
+
* @since 8.3.0
|
|
240
|
+
*/
|
|
241
|
+
export type FeedNativeAdAssets = {
|
|
242
|
+
headline?: string;
|
|
243
|
+
body?: string;
|
|
244
|
+
callToAction?: string;
|
|
245
|
+
advertiser?: string;
|
|
246
|
+
price?: string;
|
|
247
|
+
store?: string;
|
|
248
|
+
starRating?: number;
|
|
249
|
+
mediaAspectRatio?: number;
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* Banner size hints returned when a feed banner loads.
|
|
253
|
+
*
|
|
254
|
+
* @since 8.3.0
|
|
255
|
+
*/
|
|
256
|
+
export type FeedBannerAdAssets = {
|
|
257
|
+
width: number;
|
|
258
|
+
height: number;
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* Bounds of the HTML placeholder, in CSS pixels relative to the WebView viewport.
|
|
262
|
+
*
|
|
263
|
+
* @since 8.3.0
|
|
264
|
+
*/
|
|
265
|
+
export type FeedAdBounds = {
|
|
266
|
+
x: number;
|
|
267
|
+
y: number;
|
|
268
|
+
width: number;
|
|
269
|
+
height: number;
|
|
270
|
+
/** When false, the native overlay is hidden (e.g. off-screen while scrolling). */
|
|
271
|
+
visible: boolean;
|
|
272
|
+
/** `window.devicePixelRatio` from the WebView. Defaults to 1 on web. */
|
|
273
|
+
density?: number;
|
|
274
|
+
};
|
|
104
275
|
/**
|
|
105
276
|
* AdMob Plus Plugin interface for displaying Google AdMob ads in Capacitor apps.
|
|
106
277
|
*
|
|
@@ -152,6 +323,53 @@ export interface AdMobPlusPlugin {
|
|
|
152
323
|
* ```
|
|
153
324
|
*/
|
|
154
325
|
configRequest(requestConfig: RequestConfig): Promise<void>;
|
|
326
|
+
/**
|
|
327
|
+
* Request user consent information from Google's User Messaging Platform (UMP).
|
|
328
|
+
*
|
|
329
|
+
* Call this after `start()` and before loading ads for users in the EEA/UK.
|
|
330
|
+
*
|
|
331
|
+
* @param options - Optional consent request options for debugging and tagging
|
|
332
|
+
* @returns Promise that resolves with the current consent information
|
|
333
|
+
* @throws Error if the consent info request fails
|
|
334
|
+
* @since 8.2.0
|
|
335
|
+
* @example
|
|
336
|
+
* ```typescript
|
|
337
|
+
* const consentInfo = await AdMob.requestConsentInfo();
|
|
338
|
+
* if (consentInfo.isConsentFormAvailable && consentInfo.status === AdmobConsentStatus.REQUIRED) {
|
|
339
|
+
* await AdMob.showConsentForm();
|
|
340
|
+
* }
|
|
341
|
+
* ```
|
|
342
|
+
*/
|
|
343
|
+
requestConsentInfo(options?: AdmobConsentRequestOptions): Promise<AdmobConsentInfo>;
|
|
344
|
+
/**
|
|
345
|
+
* Shows the Google user consent form rendered from your GDPR message configuration.
|
|
346
|
+
*
|
|
347
|
+
* @returns Promise that resolves with updated consent information after the form is dismissed
|
|
348
|
+
* @throws Error if the consent form cannot be shown
|
|
349
|
+
* @since 8.2.0
|
|
350
|
+
* @example
|
|
351
|
+
* ```typescript
|
|
352
|
+
* const consentInfo = await AdMob.showConsentForm();
|
|
353
|
+
* if (!consentInfo.canRequestAds) {
|
|
354
|
+
* return;
|
|
355
|
+
* }
|
|
356
|
+
* ```
|
|
357
|
+
*/
|
|
358
|
+
showConsentForm(): Promise<AdmobConsentInfo>;
|
|
359
|
+
/**
|
|
360
|
+
* Shows the Google privacy options form rendered from your GDPR message configuration.
|
|
361
|
+
*
|
|
362
|
+
* Use this when your privacy message requires an in-app entry point for users to manage choices.
|
|
363
|
+
*
|
|
364
|
+
* @returns Promise that resolves when the form is dismissed
|
|
365
|
+
* @throws Error if the privacy options form cannot be shown
|
|
366
|
+
* @since 8.2.0
|
|
367
|
+
* @example
|
|
368
|
+
* ```typescript
|
|
369
|
+
* await AdMob.showPrivacyOptionsForm();
|
|
370
|
+
* ```
|
|
371
|
+
*/
|
|
372
|
+
showPrivacyOptionsForm(): Promise<void>;
|
|
155
373
|
/**
|
|
156
374
|
* Create a new ad instance.
|
|
157
375
|
*
|
|
@@ -230,6 +448,71 @@ export interface AdMobPlusPlugin {
|
|
|
230
448
|
adHide(opts: {
|
|
231
449
|
id: number;
|
|
232
450
|
}): Promise<void>;
|
|
451
|
+
/**
|
|
452
|
+
* Create an in-feed ad slot (native overlay or inline banner overlay).
|
|
453
|
+
*
|
|
454
|
+
* @param opts - Feed ad configuration
|
|
455
|
+
* @returns Promise that resolves with the feed ad instance id
|
|
456
|
+
* @since 8.3.0
|
|
457
|
+
* @example
|
|
458
|
+
* ```typescript
|
|
459
|
+
* const { id } = await AdMob.feedAdCreate({
|
|
460
|
+
* format: 'native',
|
|
461
|
+
* adUnitId: 'ca-app-pub-3940256099942544/2247696110',
|
|
462
|
+
* positionKey: 'feed-3',
|
|
463
|
+
* autoRefreshMs: 60000,
|
|
464
|
+
* });
|
|
465
|
+
* ```
|
|
466
|
+
*/
|
|
467
|
+
feedAdCreate(opts: FeedAdCreateOptions): Promise<{
|
|
468
|
+
id: number;
|
|
469
|
+
}>;
|
|
470
|
+
/**
|
|
471
|
+
* Destroy a feed ad instance and remove its native overlay.
|
|
472
|
+
*
|
|
473
|
+
* @param opts - Object containing the feed ad id
|
|
474
|
+
* @since 8.3.0
|
|
475
|
+
*/
|
|
476
|
+
feedAdDestroy(opts: {
|
|
477
|
+
id: number;
|
|
478
|
+
}): Promise<void>;
|
|
479
|
+
/**
|
|
480
|
+
* Load or reload the feed ad. Listen for `feed.load` / `feed.loadfail` events.
|
|
481
|
+
*
|
|
482
|
+
* @param opts - Object containing the feed ad id
|
|
483
|
+
* @since 8.3.0
|
|
484
|
+
*/
|
|
485
|
+
feedAdLoad(opts: {
|
|
486
|
+
id: number;
|
|
487
|
+
}): Promise<void>;
|
|
488
|
+
/**
|
|
489
|
+
* Whether the feed ad has finished loading.
|
|
490
|
+
*
|
|
491
|
+
* @param opts - Object containing the feed ad id
|
|
492
|
+
* @since 8.3.0
|
|
493
|
+
*/
|
|
494
|
+
feedAdIsLoaded(opts: {
|
|
495
|
+
id: number;
|
|
496
|
+
}): Promise<boolean>;
|
|
497
|
+
/**
|
|
498
|
+
* Position the native overlay over an HTML placeholder. Call on scroll, resize, and orientation changes.
|
|
499
|
+
*
|
|
500
|
+
* @param opts - Feed ad id and bounds from `element.getBoundingClientRect()`
|
|
501
|
+
* @since 8.3.0
|
|
502
|
+
*/
|
|
503
|
+
feedAdUpdateBounds(opts: FeedAdBounds & {
|
|
504
|
+
id: number;
|
|
505
|
+
}): Promise<void>;
|
|
506
|
+
/**
|
|
507
|
+
* Enable or disable auto-refresh (minimum 30 seconds).
|
|
508
|
+
*
|
|
509
|
+
* @param opts - Feed ad id and interval in ms, or `null` to disable
|
|
510
|
+
* @since 8.3.0
|
|
511
|
+
*/
|
|
512
|
+
feedAdSetAutoRefresh(opts: {
|
|
513
|
+
id: number;
|
|
514
|
+
autoRefreshMs: number | null;
|
|
515
|
+
}): Promise<void>;
|
|
233
516
|
/**
|
|
234
517
|
* Get the current tracking authorization status (iOS only).
|
|
235
518
|
*
|
|
@@ -279,7 +562,7 @@ export interface AdMobPlusPlugin {
|
|
|
279
562
|
* await listener.remove();
|
|
280
563
|
* ```
|
|
281
564
|
*/
|
|
282
|
-
addListener(eventName:
|
|
565
|
+
addListener<E extends AdMobPlusEventName>(eventName: E, listenerFunc: (event: AdMobPlusEventPayloadMap[E]) => void): Promise<PluginListenerHandle> & PluginListenerHandle;
|
|
283
566
|
/**
|
|
284
567
|
* Get the native Capacitor plugin version.
|
|
285
568
|
*
|
package/dist/esm/definitions.js
CHANGED
|
@@ -16,6 +16,61 @@ export var MaxAdContentRating;
|
|
|
16
16
|
/** Unspecified rating */
|
|
17
17
|
MaxAdContentRating["UNSPECIFIED"] = "";
|
|
18
18
|
})(MaxAdContentRating || (MaxAdContentRating = {}));
|
|
19
|
+
/**
|
|
20
|
+
* Consent status from Google's User Messaging Platform (UMP).
|
|
21
|
+
*
|
|
22
|
+
* @see https://developers.google.com/admob/ump/android/reference/com/google/android/ump/ConsentInformation.ConsentStatus
|
|
23
|
+
* @since 8.2.0
|
|
24
|
+
*/
|
|
25
|
+
export var AdmobConsentStatus;
|
|
26
|
+
(function (AdmobConsentStatus) {
|
|
27
|
+
/** User consent not required. */
|
|
28
|
+
AdmobConsentStatus["NOT_REQUIRED"] = "NOT_REQUIRED";
|
|
29
|
+
/** User consent already obtained. */
|
|
30
|
+
AdmobConsentStatus["OBTAINED"] = "OBTAINED";
|
|
31
|
+
/** User consent required but not yet obtained. */
|
|
32
|
+
AdmobConsentStatus["REQUIRED"] = "REQUIRED";
|
|
33
|
+
/** Unknown consent status. Call requestConsentInfo() to update it. */
|
|
34
|
+
AdmobConsentStatus["UNKNOWN"] = "UNKNOWN";
|
|
35
|
+
})(AdmobConsentStatus || (AdmobConsentStatus = {}));
|
|
36
|
+
/**
|
|
37
|
+
* Privacy options requirement status from UMP.
|
|
38
|
+
*
|
|
39
|
+
* @see https://developers.google.com/admob/ump/android/reference/com/google/android/ump/ConsentInformation.PrivacyOptionsRequirementStatus
|
|
40
|
+
* @since 8.2.0
|
|
41
|
+
*/
|
|
42
|
+
export var PrivacyOptionsRequirementStatus;
|
|
43
|
+
(function (PrivacyOptionsRequirementStatus) {
|
|
44
|
+
/** Privacy options entry point is not required. */
|
|
45
|
+
PrivacyOptionsRequirementStatus["NOT_REQUIRED"] = "NOT_REQUIRED";
|
|
46
|
+
/** Privacy options entry point is required. */
|
|
47
|
+
PrivacyOptionsRequirementStatus["REQUIRED"] = "REQUIRED";
|
|
48
|
+
/** Privacy options requirement status is unknown. */
|
|
49
|
+
PrivacyOptionsRequirementStatus["UNKNOWN"] = "UNKNOWN";
|
|
50
|
+
})(PrivacyOptionsRequirementStatus || (PrivacyOptionsRequirementStatus = {}));
|
|
51
|
+
/**
|
|
52
|
+
* Debug geography for testing UMP consent flows locally.
|
|
53
|
+
*
|
|
54
|
+
* @see https://developers.google.com/admob/ump/android/reference/com/google/android/ump/ConsentDebugSettings.DebugGeography
|
|
55
|
+
* @since 8.2.0
|
|
56
|
+
*/
|
|
57
|
+
export var AdmobConsentDebugGeography;
|
|
58
|
+
(function (AdmobConsentDebugGeography) {
|
|
59
|
+
/** Debug geography disabled. */
|
|
60
|
+
AdmobConsentDebugGeography[AdmobConsentDebugGeography["DISABLED"] = 0] = "DISABLED";
|
|
61
|
+
/** Geography appears as in EEA for debug devices. */
|
|
62
|
+
AdmobConsentDebugGeography[AdmobConsentDebugGeography["EEA"] = 1] = "EEA";
|
|
63
|
+
/**
|
|
64
|
+
* Geography appears as not in EEA for debug devices.
|
|
65
|
+
*
|
|
66
|
+
* @deprecated Use OTHER instead.
|
|
67
|
+
*/
|
|
68
|
+
AdmobConsentDebugGeography[AdmobConsentDebugGeography["NOT_EEA"] = 2] = "NOT_EEA";
|
|
69
|
+
/** Geography appears as in a regulated US state for debug devices. */
|
|
70
|
+
AdmobConsentDebugGeography[AdmobConsentDebugGeography["US"] = 3] = "US";
|
|
71
|
+
/** Geography appears as OTHER for debug devices. */
|
|
72
|
+
AdmobConsentDebugGeography[AdmobConsentDebugGeography["OTHER"] = 4] = "OTHER";
|
|
73
|
+
})(AdmobConsentDebugGeography || (AdmobConsentDebugGeography = {}));
|
|
19
74
|
/**
|
|
20
75
|
* Tracking authorization status for iOS App Tracking Transparency.
|
|
21
76
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,CAAN,IAAY,kBAWX;AAXD,WAAY,kBAAkB;IAC5B,wBAAwB;IACxB,6BAAO,CAAA;IACP,uBAAuB;IACvB,+BAAS,CAAA;IACT,wBAAwB;IACxB,+BAAS,CAAA;IACT,WAAW;IACX,6BAAO,CAAA;IACP,yBAAyB;IACzB,sCAAgB,CAAA;AAClB,CAAC,EAXW,kBAAkB,KAAlB,kBAAkB,QAW7B;AAgCD;;;;;GAKG;AACH,MAAM,CAAN,IAAY,kBASX;AATD,WAAY,kBAAkB;IAC5B,iCAAiC;IACjC,mDAA6B,CAAA;IAC7B,qCAAqC;IACrC,2CAAqB,CAAA;IACrB,kDAAkD;IAClD,2CAAqB,CAAA;IACrB,sEAAsE;IACtE,yCAAmB,CAAA;AACrB,CAAC,EATW,kBAAkB,KAAlB,kBAAkB,QAS7B;AAED;;;;;GAKG;AACH,MAAM,CAAN,IAAY,+BAOX;AAPD,WAAY,+BAA+B;IACzC,mDAAmD;IACnD,gEAA6B,CAAA;IAC7B,+CAA+C;IAC/C,wDAAqB,CAAA;IACrB,qDAAqD;IACrD,sDAAmB,CAAA;AACrB,CAAC,EAPW,+BAA+B,KAA/B,+BAA+B,QAO1C;AAED;;;;;GAKG;AACH,MAAM,CAAN,IAAY,0BAeX;AAfD,WAAY,0BAA0B;IACpC,gCAAgC;IAChC,mFAAY,CAAA;IACZ,qDAAqD;IACrD,yEAAO,CAAA;IACP;;;;OAIG;IACH,iFAAW,CAAA;IACX,sEAAsE;IACtE,uEAAM,CAAA;IACN,oDAAoD;IACpD,6EAAS,CAAA;AACX,CAAC,EAfW,0BAA0B,KAA1B,0BAA0B,QAerC;AAuCD;;;;GAIG;AACH,MAAM,CAAN,IAAY,2BASX;AATD,WAAY,2BAA2B;IACrC,yDAAyD;IACzD,+FAAiB,CAAA;IACjB,iEAAiE;IACjE,yFAAc,CAAA;IACd,gCAAgC;IAChC,iFAAU,CAAA;IACV,6BAA6B;IAC7B,yFAAc,CAAA;AAChB,CAAC,EATW,2BAA2B,KAA3B,2BAA2B,QAStC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed event name constants for {@link AdMobPlusPlugin.addListener}.
|
|
3
|
+
*
|
|
4
|
+
* @since 8.2.0
|
|
5
|
+
*/
|
|
6
|
+
export declare const AdMobPlusEvents: {
|
|
7
|
+
readonly AdClick: "ad.click";
|
|
8
|
+
readonly AdDismiss: "ad.dismiss";
|
|
9
|
+
readonly AdImpression: "ad.impression";
|
|
10
|
+
readonly AdLoad: "ad.load";
|
|
11
|
+
readonly AdLoadFail: "ad.loadfail";
|
|
12
|
+
readonly AdReward: "ad.reward";
|
|
13
|
+
readonly AdShow: "ad.show";
|
|
14
|
+
readonly AdShowFail: "ad.showfail";
|
|
15
|
+
readonly BannerClick: "banner.click";
|
|
16
|
+
readonly BannerClose: "banner.close";
|
|
17
|
+
readonly BannerImpression: "banner.impression";
|
|
18
|
+
readonly BannerLoad: "banner.load";
|
|
19
|
+
readonly BannerLoadFail: "banner.loadfail";
|
|
20
|
+
readonly BannerOpen: "banner.open";
|
|
21
|
+
readonly BannerSizeChange: "banner.sizechange";
|
|
22
|
+
readonly InterstitialDismiss: "interstitial.dismiss";
|
|
23
|
+
readonly InterstitialImpression: "interstitial.impression";
|
|
24
|
+
readonly InterstitialLoad: "interstitial.load";
|
|
25
|
+
readonly InterstitialLoadFail: "interstitial.loadfail";
|
|
26
|
+
readonly InterstitialShow: "interstitial.show";
|
|
27
|
+
readonly InterstitialShowFail: "interstitial.showfail";
|
|
28
|
+
readonly RewardedDismiss: "rewarded.dismiss";
|
|
29
|
+
readonly RewardedImpression: "rewarded.impression";
|
|
30
|
+
readonly RewardedInterstitialDismiss: "rewardedi.dismiss";
|
|
31
|
+
readonly RewardedInterstitialImpression: "rewardedi.impression";
|
|
32
|
+
readonly RewardedInterstitialLoad: "rewardedi.load";
|
|
33
|
+
readonly RewardedInterstitialLoadFail: "rewardedi.loadfail";
|
|
34
|
+
readonly RewardedInterstitialReward: "rewardedi.reward";
|
|
35
|
+
readonly RewardedInterstitialShow: "rewardedi.show";
|
|
36
|
+
readonly RewardedInterstitialShowFail: "rewardedi.showfail";
|
|
37
|
+
readonly RewardedLoad: "rewarded.load";
|
|
38
|
+
readonly RewardedLoadFail: "rewarded.loadfail";
|
|
39
|
+
readonly RewardedReward: "rewarded.reward";
|
|
40
|
+
readonly RewardedShow: "rewarded.show";
|
|
41
|
+
readonly RewardedShowFail: "rewarded.showfail";
|
|
42
|
+
readonly FeedClick: "feed.click";
|
|
43
|
+
readonly FeedClose: "feed.close";
|
|
44
|
+
readonly FeedImpression: "feed.impression";
|
|
45
|
+
readonly FeedLoad: "feed.load";
|
|
46
|
+
readonly FeedLoadFail: "feed.loadfail";
|
|
47
|
+
readonly FeedOpen: "feed.open";
|
|
48
|
+
readonly FeedRefresh: "feed.refresh";
|
|
49
|
+
};
|
|
50
|
+
export type AdMobPlusEventName = (typeof AdMobPlusEvents)[keyof typeof AdMobPlusEvents];
|
|
51
|
+
/** Event payload always includes the native ad instance id (`adId`). iOS also emits legacy `id`. */
|
|
52
|
+
export type AdMobPlusAdIdPayload = {
|
|
53
|
+
adId: number;
|
|
54
|
+
id?: number;
|
|
55
|
+
};
|
|
56
|
+
/** In-feed ad events use `feedAdId` (same numeric id as `feedAdCreate`). */
|
|
57
|
+
export type AdMobPlusFeedAdIdPayload = {
|
|
58
|
+
feedAdId: number;
|
|
59
|
+
positionKey?: string;
|
|
60
|
+
format?: 'native' | 'banner';
|
|
61
|
+
};
|
|
62
|
+
export type AdMobPlusFeedLoadPayload = AdMobPlusFeedAdIdPayload & {
|
|
63
|
+
assets?: Record<string, unknown>;
|
|
64
|
+
};
|
|
65
|
+
/** Load and fullscreen show failure payloads from native `LoadAdError` / `FullScreenContentError`. */
|
|
66
|
+
export type AdMobPlusAdFailurePayload = AdMobPlusAdIdPayload & {
|
|
67
|
+
code: number;
|
|
68
|
+
message: string;
|
|
69
|
+
/** Legacy iOS failure field; same string as `message` when present. */
|
|
70
|
+
error?: string;
|
|
71
|
+
};
|
|
72
|
+
/** Reward callbacks include the earned reward plus `adId`. */
|
|
73
|
+
export type AdMobPlusAdRewardPayload = AdMobPlusAdIdPayload & {
|
|
74
|
+
reward: {
|
|
75
|
+
amount: number;
|
|
76
|
+
type: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Maps each {@link AdMobPlusEventName} to the payload shape emitted from native code.
|
|
81
|
+
*
|
|
82
|
+
* @since 8.2.0
|
|
83
|
+
*/
|
|
84
|
+
export type AdMobPlusEventPayloadMap = {
|
|
85
|
+
[AdMobPlusEvents.AdClick]: AdMobPlusAdIdPayload;
|
|
86
|
+
[AdMobPlusEvents.AdDismiss]: AdMobPlusAdIdPayload;
|
|
87
|
+
[AdMobPlusEvents.AdImpression]: AdMobPlusAdIdPayload;
|
|
88
|
+
[AdMobPlusEvents.AdLoad]: AdMobPlusAdIdPayload;
|
|
89
|
+
[AdMobPlusEvents.AdLoadFail]: AdMobPlusAdFailurePayload;
|
|
90
|
+
[AdMobPlusEvents.AdReward]: AdMobPlusAdRewardPayload;
|
|
91
|
+
[AdMobPlusEvents.AdShow]: AdMobPlusAdIdPayload;
|
|
92
|
+
[AdMobPlusEvents.AdShowFail]: AdMobPlusAdFailurePayload;
|
|
93
|
+
[AdMobPlusEvents.BannerClick]: AdMobPlusAdIdPayload;
|
|
94
|
+
[AdMobPlusEvents.BannerClose]: AdMobPlusAdIdPayload;
|
|
95
|
+
[AdMobPlusEvents.BannerImpression]: AdMobPlusAdIdPayload;
|
|
96
|
+
[AdMobPlusEvents.BannerLoad]: AdMobPlusAdIdPayload;
|
|
97
|
+
[AdMobPlusEvents.BannerLoadFail]: AdMobPlusAdFailurePayload;
|
|
98
|
+
[AdMobPlusEvents.BannerOpen]: AdMobPlusAdIdPayload;
|
|
99
|
+
[AdMobPlusEvents.BannerSizeChange]: AdMobPlusAdIdPayload;
|
|
100
|
+
[AdMobPlusEvents.InterstitialDismiss]: AdMobPlusAdIdPayload;
|
|
101
|
+
[AdMobPlusEvents.InterstitialImpression]: AdMobPlusAdIdPayload;
|
|
102
|
+
[AdMobPlusEvents.InterstitialLoad]: AdMobPlusAdIdPayload;
|
|
103
|
+
[AdMobPlusEvents.InterstitialLoadFail]: AdMobPlusAdFailurePayload;
|
|
104
|
+
[AdMobPlusEvents.InterstitialShow]: AdMobPlusAdIdPayload;
|
|
105
|
+
[AdMobPlusEvents.InterstitialShowFail]: AdMobPlusAdFailurePayload;
|
|
106
|
+
[AdMobPlusEvents.RewardedDismiss]: AdMobPlusAdIdPayload;
|
|
107
|
+
[AdMobPlusEvents.RewardedImpression]: AdMobPlusAdIdPayload;
|
|
108
|
+
[AdMobPlusEvents.RewardedInterstitialDismiss]: AdMobPlusAdIdPayload;
|
|
109
|
+
[AdMobPlusEvents.RewardedInterstitialImpression]: AdMobPlusAdIdPayload;
|
|
110
|
+
[AdMobPlusEvents.RewardedInterstitialLoad]: AdMobPlusAdIdPayload;
|
|
111
|
+
[AdMobPlusEvents.RewardedInterstitialLoadFail]: AdMobPlusAdFailurePayload;
|
|
112
|
+
[AdMobPlusEvents.RewardedInterstitialReward]: AdMobPlusAdRewardPayload;
|
|
113
|
+
[AdMobPlusEvents.RewardedInterstitialShow]: AdMobPlusAdIdPayload;
|
|
114
|
+
[AdMobPlusEvents.RewardedInterstitialShowFail]: AdMobPlusAdFailurePayload;
|
|
115
|
+
[AdMobPlusEvents.RewardedLoad]: AdMobPlusAdIdPayload;
|
|
116
|
+
[AdMobPlusEvents.RewardedLoadFail]: AdMobPlusAdFailurePayload;
|
|
117
|
+
[AdMobPlusEvents.RewardedReward]: AdMobPlusAdRewardPayload;
|
|
118
|
+
[AdMobPlusEvents.RewardedShow]: AdMobPlusAdIdPayload;
|
|
119
|
+
[AdMobPlusEvents.RewardedShowFail]: AdMobPlusAdFailurePayload;
|
|
120
|
+
[AdMobPlusEvents.FeedClick]: AdMobPlusFeedAdIdPayload;
|
|
121
|
+
[AdMobPlusEvents.FeedClose]: AdMobPlusFeedAdIdPayload;
|
|
122
|
+
[AdMobPlusEvents.FeedImpression]: AdMobPlusFeedAdIdPayload;
|
|
123
|
+
[AdMobPlusEvents.FeedLoad]: AdMobPlusFeedLoadPayload;
|
|
124
|
+
[AdMobPlusEvents.FeedLoadFail]: AdMobPlusAdFailurePayload & AdMobPlusFeedAdIdPayload;
|
|
125
|
+
[AdMobPlusEvents.FeedOpen]: AdMobPlusFeedAdIdPayload;
|
|
126
|
+
[AdMobPlusEvents.FeedRefresh]: AdMobPlusFeedAdIdPayload;
|
|
127
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed event name constants for {@link AdMobPlusPlugin.addListener}.
|
|
3
|
+
*
|
|
4
|
+
* @since 8.2.0
|
|
5
|
+
*/
|
|
6
|
+
export const AdMobPlusEvents = {
|
|
7
|
+
AdClick: 'ad.click',
|
|
8
|
+
AdDismiss: 'ad.dismiss',
|
|
9
|
+
AdImpression: 'ad.impression',
|
|
10
|
+
AdLoad: 'ad.load',
|
|
11
|
+
AdLoadFail: 'ad.loadfail',
|
|
12
|
+
AdReward: 'ad.reward',
|
|
13
|
+
AdShow: 'ad.show',
|
|
14
|
+
AdShowFail: 'ad.showfail',
|
|
15
|
+
BannerClick: 'banner.click',
|
|
16
|
+
BannerClose: 'banner.close',
|
|
17
|
+
BannerImpression: 'banner.impression',
|
|
18
|
+
BannerLoad: 'banner.load',
|
|
19
|
+
BannerLoadFail: 'banner.loadfail',
|
|
20
|
+
BannerOpen: 'banner.open',
|
|
21
|
+
BannerSizeChange: 'banner.sizechange',
|
|
22
|
+
InterstitialDismiss: 'interstitial.dismiss',
|
|
23
|
+
InterstitialImpression: 'interstitial.impression',
|
|
24
|
+
InterstitialLoad: 'interstitial.load',
|
|
25
|
+
InterstitialLoadFail: 'interstitial.loadfail',
|
|
26
|
+
InterstitialShow: 'interstitial.show',
|
|
27
|
+
InterstitialShowFail: 'interstitial.showfail',
|
|
28
|
+
RewardedDismiss: 'rewarded.dismiss',
|
|
29
|
+
RewardedImpression: 'rewarded.impression',
|
|
30
|
+
RewardedInterstitialDismiss: 'rewardedi.dismiss',
|
|
31
|
+
RewardedInterstitialImpression: 'rewardedi.impression',
|
|
32
|
+
RewardedInterstitialLoad: 'rewardedi.load',
|
|
33
|
+
RewardedInterstitialLoadFail: 'rewardedi.loadfail',
|
|
34
|
+
RewardedInterstitialReward: 'rewardedi.reward',
|
|
35
|
+
RewardedInterstitialShow: 'rewardedi.show',
|
|
36
|
+
RewardedInterstitialShowFail: 'rewardedi.showfail',
|
|
37
|
+
RewardedLoad: 'rewarded.load',
|
|
38
|
+
RewardedLoadFail: 'rewarded.loadfail',
|
|
39
|
+
RewardedReward: 'rewarded.reward',
|
|
40
|
+
RewardedShow: 'rewarded.show',
|
|
41
|
+
RewardedShowFail: 'rewarded.showfail',
|
|
42
|
+
FeedClick: 'feed.click',
|
|
43
|
+
FeedClose: 'feed.close',
|
|
44
|
+
FeedImpression: 'feed.impression',
|
|
45
|
+
FeedLoad: 'feed.load',
|
|
46
|
+
FeedLoadFail: 'feed.loadfail',
|
|
47
|
+
FeedOpen: 'feed.open',
|
|
48
|
+
FeedRefresh: 'feed.refresh',
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,OAAO,EAAE,UAAU;IACnB,SAAS,EAAE,YAAY;IACvB,YAAY,EAAE,eAAe;IAC7B,MAAM,EAAE,SAAS;IACjB,UAAU,EAAE,aAAa;IACzB,QAAQ,EAAE,WAAW;IACrB,MAAM,EAAE,SAAS;IACjB,UAAU,EAAE,aAAa;IACzB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,cAAc;IAC3B,gBAAgB,EAAE,mBAAmB;IACrC,UAAU,EAAE,aAAa;IACzB,cAAc,EAAE,iBAAiB;IACjC,UAAU,EAAE,aAAa;IACzB,gBAAgB,EAAE,mBAAmB;IACrC,mBAAmB,EAAE,sBAAsB;IAC3C,sBAAsB,EAAE,yBAAyB;IACjD,gBAAgB,EAAE,mBAAmB;IACrC,oBAAoB,EAAE,uBAAuB;IAC7C,gBAAgB,EAAE,mBAAmB;IACrC,oBAAoB,EAAE,uBAAuB;IAC7C,eAAe,EAAE,kBAAkB;IACnC,kBAAkB,EAAE,qBAAqB;IACzC,2BAA2B,EAAE,mBAAmB;IAChD,8BAA8B,EAAE,sBAAsB;IACtD,wBAAwB,EAAE,gBAAgB;IAC1C,4BAA4B,EAAE,oBAAoB;IAClD,0BAA0B,EAAE,kBAAkB;IAC9C,wBAAwB,EAAE,gBAAgB;IAC1C,4BAA4B,EAAE,oBAAoB;IAClD,YAAY,EAAE,eAAe;IAC7B,gBAAgB,EAAE,mBAAmB;IACrC,cAAc,EAAE,iBAAiB;IACjC,YAAY,EAAE,eAAe;IAC7B,gBAAgB,EAAE,mBAAmB;IACrC,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,YAAY;IACvB,cAAc,EAAE,iBAAiB;IACjC,QAAQ,EAAE,WAAW;IACrB,YAAY,EAAE,eAAe;IAC7B,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,cAAc;CACnB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { FeedAdBounds, FeedAdCreateOptions } from './definitions';
|
|
2
|
+
declare const MIN_AUTO_REFRESH_MS = 30000;
|
|
3
|
+
/**
|
|
4
|
+
* High-level helper for in-feed native or banner ads.
|
|
5
|
+
*
|
|
6
|
+
* Policy: impressions and clicks are recorded only on the native overlay
|
|
7
|
+
* ({@link https://developers.google.com/admob/android/native/advanced | NativeAdView} /
|
|
8
|
+
* GADNativeAdView). Use a placeholder element in your HTML feed and call
|
|
9
|
+
* {@link FeedAd.attachTo} so the plugin keeps the overlay aligned on scroll and resize.
|
|
10
|
+
*/
|
|
11
|
+
export declare class FeedAd {
|
|
12
|
+
private id;
|
|
13
|
+
private createPromise;
|
|
14
|
+
private readonly opts;
|
|
15
|
+
private stopSync;
|
|
16
|
+
constructor(opts: FeedAdCreateOptions);
|
|
17
|
+
get feedAdId(): number | null;
|
|
18
|
+
create(): Promise<number>;
|
|
19
|
+
load(): Promise<void>;
|
|
20
|
+
isLoaded(): Promise<boolean>;
|
|
21
|
+
/**
|
|
22
|
+
* Load the ad (if needed) and keep a native ad view aligned with `element`.
|
|
23
|
+
*/
|
|
24
|
+
attachTo(element: HTMLElement): Promise<void>;
|
|
25
|
+
updatePosition(bounds: FeedAdBounds): Promise<void>;
|
|
26
|
+
setAutoRefresh(autoRefreshMs: number | null): Promise<void>;
|
|
27
|
+
destroy(): Promise<void>;
|
|
28
|
+
private startBoundsSync;
|
|
29
|
+
private stopBoundsSync;
|
|
30
|
+
private pushBounds;
|
|
31
|
+
}
|
|
32
|
+
export { MIN_AUTO_REFRESH_MS as FEED_AD_MIN_AUTO_REFRESH_MS };
|