@capacitor-community/admob 8.0.0 → 8.1.0
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/CapacitorCommunityAdmob.podspec +1 -1
- package/Package.swift +1 -1
- package/README.md +635 -169
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/getcapacitor/community/admob/AdMob.java +73 -23
- package/android/src/main/java/com/getcapacitor/community/admob/appopen/AppOpenAdManager.kt +92 -0
- package/android/src/main/java/com/getcapacitor/community/admob/appopen/AppOpenAdPlugin.kt +122 -0
- package/android/src/main/java/com/getcapacitor/community/admob/appopen/AppOpenAdPluginEvents.kt +10 -0
- package/android/src/main/java/com/getcapacitor/community/admob/banner/BannerAdPluginEvents.kt +2 -1
- package/android/src/main/java/com/getcapacitor/community/admob/banner/BannerExecutor.java +79 -29
- package/android/src/main/java/com/getcapacitor/community/admob/helpers/FullscreenPluginCallback.kt +7 -2
- package/android/src/main/java/com/getcapacitor/community/admob/interstitial/AdInterstitialExecutor.java +21 -3
- package/android/src/main/java/com/getcapacitor/community/admob/interstitial/InterstitialAdCallbackAndListeners.kt +12 -2
- package/android/src/main/java/com/getcapacitor/community/admob/interstitial/InterstitialAdPluginPluginEvent.kt +1 -0
- package/android/src/main/java/com/getcapacitor/community/admob/models/AdMobRevenueData.kt +15 -0
- package/android/src/main/java/com/getcapacitor/community/admob/models/AdOptions.java +10 -0
- package/android/src/main/java/com/getcapacitor/community/admob/rewarded/AdRewardExecutor.java +20 -3
- package/android/src/main/java/com/getcapacitor/community/admob/rewarded/RewardAdPluginEvents.kt +1 -0
- package/android/src/main/java/com/getcapacitor/community/admob/rewarded/RewardedAdCallbackAndListeners.kt +14 -4
- package/android/src/main/java/com/getcapacitor/community/admob/rewardedinterstitial/AdRewardInterstitialExecutor.java +20 -3
- package/android/src/main/java/com/getcapacitor/community/admob/rewardedinterstitial/RewardInterstitialAdPluginEvents.kt +1 -0
- package/android/src/main/java/com/getcapacitor/community/admob/rewardedinterstitial/RewardedInterstitialAdCallbackAndListeners.kt +14 -3
- package/dist/docs.json +740 -193
- package/dist/esm/app-open/app-open-ad-options.interface.d.ts +9 -0
- package/dist/esm/app-open/app-open-ad-options.interface.js +2 -0
- package/dist/esm/app-open/app-open-ad-options.interface.js.map +1 -0
- package/dist/esm/app-open/app-open-ad-plugin-events.enum.d.ts +26 -0
- package/dist/esm/app-open/app-open-ad-plugin-events.enum.js +28 -0
- package/dist/esm/app-open/app-open-ad-plugin-events.enum.js.map +1 -0
- package/dist/esm/app-open/app-open-definitions.interface.d.ts +50 -0
- package/dist/esm/app-open/app-open-definitions.interface.js +2 -0
- package/dist/esm/app-open/app-open-definitions.interface.js.map +1 -0
- package/dist/esm/app-open/index.d.ts +3 -0
- package/dist/esm/app-open/index.js +4 -0
- package/dist/esm/app-open/index.js.map +1 -0
- package/dist/esm/banner/banner-ad-options.interface.d.ts +5 -6
- package/dist/esm/banner/banner-ad-plugin-events.enum.d.ts +17 -4
- package/dist/esm/banner/banner-ad-plugin-events.enum.js +16 -3
- package/dist/esm/banner/banner-ad-plugin-events.enum.js.map +1 -1
- package/dist/esm/banner/banner-ad-position.enum.d.ts +3 -3
- package/dist/esm/banner/banner-ad-position.enum.js +3 -3
- package/dist/esm/banner/banner-ad-size.enum.d.ts +4 -3
- package/dist/esm/banner/banner-ad-size.enum.js +4 -3
- package/dist/esm/banner/banner-ad-size.enum.js.map +1 -1
- package/dist/esm/banner/banner-definitions.interface.d.ts +17 -10
- package/dist/esm/banner/banner-size.interface.d.ts +8 -1
- package/dist/esm/definitions.d.ts +19 -17
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interstitial/interstitial-ad-plugin-events.enum.d.ts +10 -6
- package/dist/esm/interstitial/interstitial-ad-plugin-events.enum.js +9 -5
- package/dist/esm/interstitial/interstitial-ad-plugin-events.enum.js.map +1 -1
- package/dist/esm/interstitial/interstitial-definitions.interface.d.ts +24 -4
- package/dist/esm/reward/reward-ad-options.interface.d.ts +7 -6
- package/dist/esm/reward/reward-ad-plugin-events.enum.d.ts +13 -12
- package/dist/esm/reward/reward-ad-plugin-events.enum.js +12 -11
- package/dist/esm/reward/reward-ad-plugin-events.enum.js.map +1 -1
- package/dist/esm/reward/reward-definitions.interface.d.ts +27 -4
- package/dist/esm/reward/reward-item.interface.d.ts +3 -4
- package/dist/esm/reward-interstitial/reward-interstitial-ad-options.interface.d.ts +7 -6
- package/dist/esm/reward-interstitial/reward-interstitial-ad-plugin-events.enum.d.ts +13 -12
- package/dist/esm/reward-interstitial/reward-interstitial-ad-plugin-events.enum.js +12 -11
- package/dist/esm/reward-interstitial/reward-interstitial-ad-plugin-events.enum.js.map +1 -1
- package/dist/esm/reward-interstitial/reward-interstitial-definitions.interface.d.ts +30 -7
- package/dist/esm/reward-interstitial/reward-interstitial-item.interface.d.ts +3 -4
- package/dist/esm/shared/ad-load-info.interface.d.ts +6 -0
- package/dist/esm/shared/ad-mob-revenue-data.interface.d.ts +50 -0
- package/dist/esm/shared/ad-mob-revenue-data.interface.js +23 -0
- package/dist/esm/shared/ad-mob-revenue-data.interface.js.map +1 -0
- package/dist/esm/shared/ad-options.interface.d.ts +9 -11
- package/dist/esm/shared/ad-show-options.interface.d.ts +12 -0
- package/dist/esm/shared/ad-show-options.interface.js +2 -0
- package/dist/esm/shared/ad-show-options.interface.js.map +1 -0
- package/dist/esm/shared/admob-error.interface.d.ts +3 -2
- package/dist/esm/shared/index.d.ts +2 -0
- package/dist/esm/shared/index.js +2 -0
- package/dist/esm/shared/index.js.map +1 -1
- package/dist/esm/shared/tracking-authorization-status.interface.d.ts +6 -1
- package/dist/esm/web.d.ts +13 -4
- package/dist/esm/web.js +25 -9
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +131 -45
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +131 -45
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/AdMobPlugin/AdMobPlugin.swift +30 -4
- package/ios/Sources/AdMobPlugin/AppOpen/AppOpenAdManager.swift +112 -0
- package/ios/Sources/AdMobPlugin/AppOpen/AppOpenAdPlugin.swift +101 -0
- package/ios/Sources/AdMobPlugin/AppOpen/AppOpenAdPluginEvents.swift +8 -0
- package/ios/Sources/AdMobPlugin/Banner/BannerAdPluginEvents.swift +1 -0
- package/ios/Sources/AdMobPlugin/Banner/BannerExecutor.swift +20 -6
- package/ios/Sources/AdMobPlugin/Interstitial/AdInterstitialExecutor.swift +41 -5
- package/ios/Sources/AdMobPlugin/Interstitial/InterstitialAdPluginEvents.swift +1 -0
- package/ios/Sources/AdMobPlugin/Rewarded/AdRewardExecutor.swift +44 -5
- package/ios/Sources/AdMobPlugin/Rewarded/RewardAdPluginEvents.swift +1 -0
- package/ios/Sources/AdMobPlugin/RewardedInterstitial/AdRewardInterstitialExecutor.swift +45 -6
- package/ios/Sources/AdMobPlugin/RewardedInterstitial/RewardInterstitialAdPluginEvents.swift +1 -0
- package/package.json +2 -1
|
@@ -1,30 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common options for requesting an ad.
|
|
3
|
+
*/
|
|
1
4
|
export interface AdOptions {
|
|
2
5
|
/**
|
|
3
|
-
* The ad unit ID
|
|
6
|
+
* The ad unit ID to load.
|
|
4
7
|
*
|
|
5
8
|
* @see https://support.google.com/admob/answer/7356431?hl=en
|
|
6
9
|
* @since 1.1.2
|
|
7
10
|
*/
|
|
8
11
|
adId: string;
|
|
9
12
|
/**
|
|
10
|
-
*
|
|
13
|
+
* Whether to request a test ad.
|
|
11
14
|
*
|
|
12
15
|
* @default false
|
|
13
16
|
* @since 1.1.2
|
|
14
17
|
*/
|
|
15
18
|
isTesting?: boolean;
|
|
16
19
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* If position is TOP_CENTER, margin is be margin-top.
|
|
20
|
+
* The banner margin in logical display units (dp on Android and points on iOS).
|
|
21
|
+
* For `BOTTOM_CENTER`, this is the bottom margin. For `TOP_CENTER`, this is the top margin.
|
|
20
22
|
*
|
|
21
23
|
* @default 0
|
|
22
24
|
* @since 1.1.2
|
|
23
25
|
*/
|
|
24
26
|
margin?: number;
|
|
25
27
|
/**
|
|
26
|
-
*
|
|
27
|
-
* Set this to true to request Non-Personalized Ads
|
|
28
|
+
* Whether to request non-personalized ads.
|
|
28
29
|
*
|
|
29
30
|
* @see https://developers.google.com/admob/ios/eu-consent
|
|
30
31
|
* @see https://developers.google.com/admob/android/eu-consent
|
|
@@ -33,10 +34,7 @@ export interface AdOptions {
|
|
|
33
34
|
*/
|
|
34
35
|
npa?: boolean;
|
|
35
36
|
/**
|
|
36
|
-
*
|
|
37
|
-
* Call this method before show.
|
|
38
|
-
* During show, if this flag is on and immersive mode is supported,
|
|
39
|
-
* SYSTEM_UI_FLAG_IMMERSIVE_STICKY &SYSTEM_UI_FLAG_HIDE_NAVIGATION will be turned on for interstitial or reward ad.
|
|
37
|
+
* Whether to display a full-screen ad in immersive mode on Android.
|
|
40
38
|
*
|
|
41
39
|
* @see https://developers.google.com/admob/android/reference/com/google/android/gms/ads/interstitial/InterstitialAd#setImmersiveMode(boolean)
|
|
42
40
|
* @see https://developers.google.com/admob/android/reference/com/google/android/gms/ads/rewarded/RewardedAd#setImmersiveMode(boolean)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for selecting a previously loaded ad to show or inspect.
|
|
3
|
+
*/
|
|
4
|
+
export interface AdShowOptions {
|
|
5
|
+
/**
|
|
6
|
+
* The ad unit ID of a previously prepared ad to target.
|
|
7
|
+
* If omitted, the operation targets the most recently prepared ad.
|
|
8
|
+
*
|
|
9
|
+
* @since 8.0.1
|
|
10
|
+
*/
|
|
11
|
+
adId?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ad-show-options.interface.js","sourceRoot":"","sources":["../../../src/shared/ad-show-options.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* An error returned by the Google Mobile Ads SDK.
|
|
3
|
+
*
|
|
4
|
+
* @see https://developers.google.com/admob/android/reference/com/google/android/gms/ads/AdError
|
|
4
5
|
*/
|
|
5
6
|
export interface AdMobError {
|
|
6
7
|
/**
|
package/dist/esm/shared/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The current iOS App Tracking Transparency authorization status.
|
|
3
|
+
*
|
|
4
|
+
* @see https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/authorizationstatus
|
|
3
5
|
*/
|
|
4
6
|
export interface TrackingAuthorizationStatusInterface {
|
|
7
|
+
/**
|
|
8
|
+
* The authorization status reported by App Tracking Transparency.
|
|
9
|
+
*/
|
|
5
10
|
status: 'authorized' | 'denied' | 'notDetermined' | 'restricted';
|
|
6
11
|
}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { WebPlugin } from '@capacitor/core';
|
|
2
2
|
import type { AdMobPlugin, ApplicationMutedOptions, ApplicationVolumeOptions, AdmobConsentInfo, AdmobConsentRequestOptions } from '.';
|
|
3
|
+
import type { AppOpenAdOptions } from './app-open/app-open-ad-options.interface';
|
|
3
4
|
import type { AdMobRewardItem } from './reward';
|
|
4
|
-
import type { AdOptions, AdLoadInfo } from './shared';
|
|
5
|
+
import type { AdOptions, AdLoadInfo, AdShowOptions } from './shared';
|
|
5
6
|
import type { TrackingAuthorizationStatusInterface } from './shared/tracking-authorization-status.interface';
|
|
6
7
|
export declare class AdMobWeb extends WebPlugin implements AdMobPlugin {
|
|
7
8
|
initialize(): Promise<void>;
|
|
@@ -18,9 +19,17 @@ export declare class AdMobWeb extends WebPlugin implements AdMobPlugin {
|
|
|
18
19
|
resumeBanner(): Promise<void>;
|
|
19
20
|
removeBanner(): Promise<void>;
|
|
20
21
|
prepareInterstitial(options: AdOptions): Promise<AdLoadInfo>;
|
|
21
|
-
showInterstitial(): Promise<void>;
|
|
22
|
+
showInterstitial(options?: AdShowOptions): Promise<void>;
|
|
22
23
|
prepareRewardVideoAd(options: AdOptions): Promise<AdLoadInfo>;
|
|
23
|
-
showRewardVideoAd(): Promise<AdMobRewardItem>;
|
|
24
|
+
showRewardVideoAd(options?: AdShowOptions): Promise<AdMobRewardItem>;
|
|
24
25
|
prepareRewardInterstitialAd(options: AdOptions): Promise<AdLoadInfo>;
|
|
25
|
-
showRewardInterstitialAd(): Promise<AdMobRewardItem>;
|
|
26
|
+
showRewardInterstitialAd(options?: AdShowOptions): Promise<AdMobRewardItem>;
|
|
27
|
+
loadAppOpen(options: AppOpenAdOptions): Promise<AdLoadInfo>;
|
|
28
|
+
showAppOpen(options?: AdShowOptions): Promise<void>;
|
|
29
|
+
isAppOpenLoaded(): Promise<{
|
|
30
|
+
value: boolean;
|
|
31
|
+
}>;
|
|
32
|
+
addListener(eventName: string, listenerFunc: (...args: any[]) => void): Promise<{
|
|
33
|
+
remove: () => Promise<void>;
|
|
34
|
+
}>;
|
|
26
35
|
}
|
package/dist/esm/web.js
CHANGED
|
@@ -45,15 +45,12 @@ export class AdMobWeb extends WebPlugin {
|
|
|
45
45
|
async showBanner(options) {
|
|
46
46
|
console.log('showBanner', options);
|
|
47
47
|
}
|
|
48
|
-
// Hide the banner, remove it from screen, but can show it later
|
|
49
48
|
async hideBanner() {
|
|
50
49
|
console.log('hideBanner');
|
|
51
50
|
}
|
|
52
|
-
// Resume the banner, show it after hide
|
|
53
51
|
async resumeBanner() {
|
|
54
52
|
console.log('resumeBanner');
|
|
55
53
|
}
|
|
56
|
-
// Destroy the banner, remove it from screen.
|
|
57
54
|
async removeBanner() {
|
|
58
55
|
console.log('removeBanner');
|
|
59
56
|
}
|
|
@@ -63,32 +60,51 @@ export class AdMobWeb extends WebPlugin {
|
|
|
63
60
|
adUnitId: options.adId,
|
|
64
61
|
};
|
|
65
62
|
}
|
|
66
|
-
async showInterstitial() {
|
|
67
|
-
console.log('showInterstitial');
|
|
63
|
+
async showInterstitial(options) {
|
|
64
|
+
console.log('showInterstitial', options);
|
|
68
65
|
}
|
|
69
66
|
async prepareRewardVideoAd(options) {
|
|
70
|
-
console.log(options);
|
|
67
|
+
console.log('prepareRewardVideoAd', options);
|
|
71
68
|
return {
|
|
72
69
|
adUnitId: options.adId,
|
|
73
70
|
};
|
|
74
71
|
}
|
|
75
|
-
async showRewardVideoAd() {
|
|
72
|
+
async showRewardVideoAd(options) {
|
|
73
|
+
console.log('showRewardVideoAd', options);
|
|
76
74
|
return {
|
|
77
75
|
type: '',
|
|
78
76
|
amount: 0,
|
|
79
77
|
};
|
|
80
78
|
}
|
|
81
79
|
async prepareRewardInterstitialAd(options) {
|
|
82
|
-
console.log(options);
|
|
80
|
+
console.log('prepareRewardInterstitialAd', options);
|
|
83
81
|
return {
|
|
84
82
|
adUnitId: options.adId,
|
|
85
83
|
};
|
|
86
84
|
}
|
|
87
|
-
async showRewardInterstitialAd() {
|
|
85
|
+
async showRewardInterstitialAd(options) {
|
|
86
|
+
console.log('showRewardInterstitialAd', options);
|
|
88
87
|
return {
|
|
89
88
|
type: '',
|
|
90
89
|
amount: 0,
|
|
91
90
|
};
|
|
92
91
|
}
|
|
92
|
+
async loadAppOpen(options) {
|
|
93
|
+
console.log('loadAppOpen', options);
|
|
94
|
+
return {
|
|
95
|
+
adUnitId: options.adId,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
async showAppOpen(options) {
|
|
99
|
+
console.log('showAppOpen', options);
|
|
100
|
+
}
|
|
101
|
+
async isAppOpenLoaded() {
|
|
102
|
+
return { value: false };
|
|
103
|
+
}
|
|
104
|
+
addListener(eventName, listenerFunc) {
|
|
105
|
+
void listenerFunc;
|
|
106
|
+
console.log('addListener', eventName);
|
|
107
|
+
return Promise.resolve({ remove: () => Promise.resolve() });
|
|
108
|
+
}
|
|
93
109
|
}
|
|
94
110
|
//# sourceMappingURL=web.js.map
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAU5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,+BAA+B,EAAE,MAAM,mDAAmD,CAAC;AAKpG,MAAM,OAAO,QAAS,SAAQ,SAAS;IACrC,KAAK,CAAC,UAAU;QACd,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,4BAA4B;QAChC,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,2BAA2B;QAC/B,OAAO;YACL,MAAM,EAAE,YAAY;SACrB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,OAAoC;QAC3D,OAAO,CAAC,GAAG,CAAC,oBAAoB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ED,KAAK,CAAC,eAAe;QACnB,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IAC1B,CAAC;IAED,WAAW,CAAC,SAAiB,EAAE,YAAsC;QACnE,KAAK,YAAY,CAAC;QAClB,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;QACtC,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC9D,CAAC;CACF"}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -25,21 +25,34 @@ exports.MaxAdContentRating = void 0;
|
|
|
25
25
|
// This enum should be keep in sync with their native equivalents with the same name
|
|
26
26
|
exports.BannerAdPluginEvents = void 0;
|
|
27
27
|
(function (BannerAdPluginEvents) {
|
|
28
|
+
/**
|
|
29
|
+
* Emits when the displayed banner size changes.
|
|
30
|
+
*/
|
|
28
31
|
BannerAdPluginEvents["SizeChanged"] = "bannerAdSizeChanged";
|
|
32
|
+
/**
|
|
33
|
+
* Emits when a banner ad has loaded.
|
|
34
|
+
*/
|
|
29
35
|
BannerAdPluginEvents["Loaded"] = "bannerAdLoaded";
|
|
36
|
+
/**
|
|
37
|
+
* Emits when a banner ad fails to load.
|
|
38
|
+
*/
|
|
30
39
|
BannerAdPluginEvents["FailedToLoad"] = "bannerAdFailedToLoad";
|
|
31
40
|
/**
|
|
32
|
-
*
|
|
41
|
+
* Emits when a banner opens an overlay after the user taps it.
|
|
33
42
|
*/
|
|
34
43
|
BannerAdPluginEvents["Opened"] = "bannerAdOpened";
|
|
35
44
|
/**
|
|
36
|
-
*
|
|
45
|
+
* Emits when the banner overlay is closed.
|
|
37
46
|
*/
|
|
38
47
|
BannerAdPluginEvents["Closed"] = "bannerAdClosed";
|
|
39
48
|
/**
|
|
40
|
-
*
|
|
49
|
+
* Emits when an impression is recorded for the banner ad.
|
|
41
50
|
*/
|
|
42
51
|
BannerAdPluginEvents["AdImpression"] = "bannerAdImpression";
|
|
52
|
+
/**
|
|
53
|
+
* Emits impression-level ad revenue data when a paid event is recorded.
|
|
54
|
+
*/
|
|
55
|
+
BannerAdPluginEvents["AdPaid"] = "bannerAdPaid";
|
|
43
56
|
})(exports.BannerAdPluginEvents || (exports.BannerAdPluginEvents = {}));
|
|
44
57
|
|
|
45
58
|
/**
|
|
@@ -48,15 +61,15 @@ exports.BannerAdPluginEvents = void 0;
|
|
|
48
61
|
exports.BannerAdPosition = void 0;
|
|
49
62
|
(function (BannerAdPosition) {
|
|
50
63
|
/**
|
|
51
|
-
*
|
|
64
|
+
* Positions the banner at the top center of the screen.
|
|
52
65
|
*/
|
|
53
66
|
BannerAdPosition["TOP_CENTER"] = "TOP_CENTER";
|
|
54
67
|
/**
|
|
55
|
-
*
|
|
68
|
+
* Positions the banner at the center of the screen.
|
|
56
69
|
*/
|
|
57
70
|
BannerAdPosition["CENTER"] = "CENTER";
|
|
58
71
|
/**
|
|
59
|
-
*
|
|
72
|
+
* Positions the banner at the bottom center of the screen.
|
|
60
73
|
*/
|
|
61
74
|
BannerAdPosition["BOTTOM_CENTER"] = "BOTTOM_CENTER";
|
|
62
75
|
})(exports.BannerAdPosition || (exports.BannerAdPosition = {}));
|
|
@@ -98,9 +111,10 @@ exports.BannerAdSize = void 0;
|
|
|
98
111
|
*/
|
|
99
112
|
BannerAdSize["ADAPTIVE_BANNER"] = "ADAPTIVE_BANNER";
|
|
100
113
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
114
|
+
* A legacy smart banner sized to the screen width.
|
|
115
|
+
* Retained for compatibility; use `ADAPTIVE_BANNER` for new integrations.
|
|
116
|
+
*
|
|
117
|
+
* @deprecated Use `ADAPTIVE_BANNER` instead.
|
|
104
118
|
*/
|
|
105
119
|
BannerAdSize["SMART_BANNER"] = "SMART_BANNER";
|
|
106
120
|
})(exports.BannerAdSize || (exports.BannerAdSize = {}));
|
|
@@ -109,95 +123,101 @@ exports.BannerAdSize = void 0;
|
|
|
109
123
|
exports.InterstitialAdPluginEvents = void 0;
|
|
110
124
|
(function (InterstitialAdPluginEvents) {
|
|
111
125
|
/**
|
|
112
|
-
* Emits
|
|
126
|
+
* Emits when an interstitial ad has loaded and is ready to show.
|
|
113
127
|
*/
|
|
114
128
|
InterstitialAdPluginEvents["Loaded"] = "interstitialAdLoaded";
|
|
115
129
|
/**
|
|
116
|
-
* Emits
|
|
130
|
+
* Emits when an interstitial ad fails to load.
|
|
117
131
|
*/
|
|
118
132
|
InterstitialAdPluginEvents["FailedToLoad"] = "interstitialAdFailedToLoad";
|
|
119
133
|
/**
|
|
120
|
-
* Emits when
|
|
134
|
+
* Emits when an interstitial ad is shown.
|
|
121
135
|
*/
|
|
122
136
|
InterstitialAdPluginEvents["Showed"] = "interstitialAdShowed";
|
|
123
137
|
/**
|
|
124
|
-
* Emits when
|
|
138
|
+
* Emits when a loaded interstitial ad fails to show.
|
|
125
139
|
*/
|
|
126
140
|
InterstitialAdPluginEvents["FailedToShow"] = "interstitialAdFailedToShow";
|
|
127
141
|
/**
|
|
128
|
-
* Emits when
|
|
142
|
+
* Emits when an interstitial ad is dismissed.
|
|
129
143
|
*/
|
|
130
144
|
InterstitialAdPluginEvents["Dismissed"] = "interstitialAdDismissed";
|
|
145
|
+
/**
|
|
146
|
+
* Emits impression-level ad revenue data when a paid event is recorded.
|
|
147
|
+
*/
|
|
148
|
+
InterstitialAdPluginEvents["AdImpression"] = "interstitialAdImpression";
|
|
131
149
|
})(exports.InterstitialAdPluginEvents || (exports.InterstitialAdPluginEvents = {}));
|
|
132
150
|
|
|
133
151
|
// This enum should be keep in sync with their native equivalents with the same name
|
|
134
152
|
exports.RewardInterstitialAdPluginEvents = void 0;
|
|
135
153
|
(function (RewardInterstitialAdPluginEvents) {
|
|
136
154
|
/**
|
|
137
|
-
* Emits
|
|
155
|
+
* Emits when a rewarded interstitial ad has loaded and is ready to show.
|
|
138
156
|
*/
|
|
139
157
|
RewardInterstitialAdPluginEvents["Loaded"] = "onRewardedInterstitialAdLoaded";
|
|
140
158
|
/**
|
|
141
|
-
* Emits
|
|
159
|
+
* Emits when a rewarded interstitial ad fails to load.
|
|
142
160
|
*/
|
|
143
161
|
RewardInterstitialAdPluginEvents["FailedToLoad"] = "onRewardedInterstitialAdFailedToLoad";
|
|
144
162
|
/**
|
|
145
|
-
* Emits when
|
|
163
|
+
* Emits when a rewarded interstitial ad is shown.
|
|
146
164
|
*/
|
|
147
165
|
RewardInterstitialAdPluginEvents["Showed"] = "onRewardedInterstitialAdShowed";
|
|
148
166
|
/**
|
|
149
|
-
* Emits when
|
|
167
|
+
* Emits when a loaded rewarded interstitial ad fails to show.
|
|
150
168
|
*/
|
|
151
169
|
RewardInterstitialAdPluginEvents["FailedToShow"] = "onRewardedInterstitialAdFailedToShow";
|
|
152
170
|
/**
|
|
153
|
-
* Emits when
|
|
171
|
+
* Emits when a rewarded interstitial ad is dismissed.
|
|
154
172
|
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
* 1. The user starts the video ad but close it before the reward emit.
|
|
158
|
-
* 2. The user start the video and see it until end, then gets the reward
|
|
159
|
-
* and after that the ad is closed.
|
|
173
|
+
* This event does not indicate whether the user earned a reward. Listen for
|
|
174
|
+
* `Rewarded` separately before granting the reward.
|
|
160
175
|
*/
|
|
161
176
|
RewardInterstitialAdPluginEvents["Dismissed"] = "onRewardedInterstitialAdDismissed";
|
|
162
177
|
/**
|
|
163
|
-
* Emits when user
|
|
178
|
+
* Emits when the user earns the advertised reward.
|
|
164
179
|
*/
|
|
165
180
|
RewardInterstitialAdPluginEvents["Rewarded"] = "onRewardedInterstitialAdReward";
|
|
181
|
+
/**
|
|
182
|
+
* Emits impression-level ad revenue data when a paid event is recorded.
|
|
183
|
+
*/
|
|
184
|
+
RewardInterstitialAdPluginEvents["AdImpression"] = "onRewardedInterstitialAdImpression";
|
|
166
185
|
})(exports.RewardInterstitialAdPluginEvents || (exports.RewardInterstitialAdPluginEvents = {}));
|
|
167
186
|
|
|
168
187
|
// This enum should be keep in sync with their native equivalents with the same name
|
|
169
188
|
exports.RewardAdPluginEvents = void 0;
|
|
170
189
|
(function (RewardAdPluginEvents) {
|
|
171
190
|
/**
|
|
172
|
-
* Emits
|
|
191
|
+
* Emits when a rewarded ad has loaded and is ready to show.
|
|
173
192
|
*/
|
|
174
193
|
RewardAdPluginEvents["Loaded"] = "onRewardedVideoAdLoaded";
|
|
175
194
|
/**
|
|
176
|
-
* Emits
|
|
195
|
+
* Emits when a rewarded ad fails to load.
|
|
177
196
|
*/
|
|
178
197
|
RewardAdPluginEvents["FailedToLoad"] = "onRewardedVideoAdFailedToLoad";
|
|
179
198
|
/**
|
|
180
|
-
* Emits when
|
|
199
|
+
* Emits when a rewarded ad is shown.
|
|
181
200
|
*/
|
|
182
201
|
RewardAdPluginEvents["Showed"] = "onRewardedVideoAdShowed";
|
|
183
202
|
/**
|
|
184
|
-
* Emits when
|
|
203
|
+
* Emits when a loaded rewarded ad fails to show.
|
|
185
204
|
*/
|
|
186
205
|
RewardAdPluginEvents["FailedToShow"] = "onRewardedVideoAdFailedToShow";
|
|
187
206
|
/**
|
|
188
|
-
* Emits when
|
|
207
|
+
* Emits when a rewarded ad is dismissed.
|
|
189
208
|
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
* 1. The user starts the video ad but close it before the reward emit.
|
|
193
|
-
* 2. The user start the video and see it until end, then gets the reward
|
|
194
|
-
* and after that the ad is closed.
|
|
209
|
+
* This event does not indicate whether the user earned a reward. Listen for
|
|
210
|
+
* `Rewarded` separately before granting the reward.
|
|
195
211
|
*/
|
|
196
212
|
RewardAdPluginEvents["Dismissed"] = "onRewardedVideoAdDismissed";
|
|
197
213
|
/**
|
|
198
|
-
* Emits when user
|
|
214
|
+
* Emits when the user earns the advertised reward.
|
|
199
215
|
*/
|
|
200
216
|
RewardAdPluginEvents["Rewarded"] = "onRewardedVideoAdReward";
|
|
217
|
+
/**
|
|
218
|
+
* Emits impression-level ad revenue data when a paid event is recorded.
|
|
219
|
+
*/
|
|
220
|
+
RewardAdPluginEvents["AdImpression"] = "onRewardedVideoAdImpression";
|
|
201
221
|
})(exports.RewardAdPluginEvents || (exports.RewardAdPluginEvents = {}));
|
|
202
222
|
|
|
203
223
|
/**
|
|
@@ -255,6 +275,57 @@ exports.AdmobConsentDebugGeography = void 0;
|
|
|
255
275
|
AdmobConsentDebugGeography[AdmobConsentDebugGeography["OTHER"] = 4] = "OTHER";
|
|
256
276
|
})(exports.AdmobConsentDebugGeography || (exports.AdmobConsentDebugGeography = {}));
|
|
257
277
|
|
|
278
|
+
/**
|
|
279
|
+
* The precision of an impression-level ad value.
|
|
280
|
+
*/
|
|
281
|
+
exports.AdValuePrecision = void 0;
|
|
282
|
+
(function (AdValuePrecision) {
|
|
283
|
+
/**
|
|
284
|
+
* The ad value precision is unknown.
|
|
285
|
+
*/
|
|
286
|
+
AdValuePrecision[AdValuePrecision["Unknown"] = 0] = "Unknown";
|
|
287
|
+
/**
|
|
288
|
+
* The ad value is estimated from aggregated data.
|
|
289
|
+
*/
|
|
290
|
+
AdValuePrecision[AdValuePrecision["Estimated"] = 1] = "Estimated";
|
|
291
|
+
/**
|
|
292
|
+
* The ad value was provided by the publisher.
|
|
293
|
+
*/
|
|
294
|
+
AdValuePrecision[AdValuePrecision["PublisherProvided"] = 2] = "PublisherProvided";
|
|
295
|
+
/**
|
|
296
|
+
* The ad value is the precise value paid for this ad.
|
|
297
|
+
*/
|
|
298
|
+
AdValuePrecision[AdValuePrecision["Precise"] = 3] = "Precise";
|
|
299
|
+
})(exports.AdValuePrecision || (exports.AdValuePrecision = {}));
|
|
300
|
+
|
|
301
|
+
exports.AppOpenAdPluginEvents = void 0;
|
|
302
|
+
(function (AppOpenAdPluginEvents) {
|
|
303
|
+
/**
|
|
304
|
+
* Emits when an App Open ad has loaded.
|
|
305
|
+
*/
|
|
306
|
+
AppOpenAdPluginEvents["Loaded"] = "appOpenAdLoaded";
|
|
307
|
+
/**
|
|
308
|
+
* Emits when an App Open ad fails to load.
|
|
309
|
+
*/
|
|
310
|
+
AppOpenAdPluginEvents["FailedToLoad"] = "appOpenAdFailedToLoad";
|
|
311
|
+
/**
|
|
312
|
+
* Emits when an App Open ad is shown.
|
|
313
|
+
*/
|
|
314
|
+
AppOpenAdPluginEvents["Opened"] = "appOpenAdOpened";
|
|
315
|
+
/**
|
|
316
|
+
* Emits when an App Open ad is dismissed.
|
|
317
|
+
*/
|
|
318
|
+
AppOpenAdPluginEvents["Closed"] = "appOpenAdClosed";
|
|
319
|
+
/**
|
|
320
|
+
* Emits when a loaded App Open ad fails to show.
|
|
321
|
+
*/
|
|
322
|
+
AppOpenAdPluginEvents["FailedToShow"] = "appOpenAdFailedToShow";
|
|
323
|
+
/**
|
|
324
|
+
* Emits impression-level ad revenue data when a paid event is recorded.
|
|
325
|
+
*/
|
|
326
|
+
AppOpenAdPluginEvents["AdImpression"] = "appOpenAdImpression";
|
|
327
|
+
})(exports.AppOpenAdPluginEvents || (exports.AppOpenAdPluginEvents = {}));
|
|
328
|
+
|
|
258
329
|
const AdMob = core.registerPlugin('AdMob', {
|
|
259
330
|
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.AdMobWeb()),
|
|
260
331
|
});
|
|
@@ -324,15 +395,12 @@ class AdMobWeb extends core.WebPlugin {
|
|
|
324
395
|
async showBanner(options) {
|
|
325
396
|
console.log('showBanner', options);
|
|
326
397
|
}
|
|
327
|
-
// Hide the banner, remove it from screen, but can show it later
|
|
328
398
|
async hideBanner() {
|
|
329
399
|
console.log('hideBanner');
|
|
330
400
|
}
|
|
331
|
-
// Resume the banner, show it after hide
|
|
332
401
|
async resumeBanner() {
|
|
333
402
|
console.log('resumeBanner');
|
|
334
403
|
}
|
|
335
|
-
// Destroy the banner, remove it from screen.
|
|
336
404
|
async removeBanner() {
|
|
337
405
|
console.log('removeBanner');
|
|
338
406
|
}
|
|
@@ -342,33 +410,51 @@ class AdMobWeb extends core.WebPlugin {
|
|
|
342
410
|
adUnitId: options.adId,
|
|
343
411
|
};
|
|
344
412
|
}
|
|
345
|
-
async showInterstitial() {
|
|
346
|
-
console.log('showInterstitial');
|
|
413
|
+
async showInterstitial(options) {
|
|
414
|
+
console.log('showInterstitial', options);
|
|
347
415
|
}
|
|
348
416
|
async prepareRewardVideoAd(options) {
|
|
349
|
-
console.log(options);
|
|
417
|
+
console.log('prepareRewardVideoAd', options);
|
|
350
418
|
return {
|
|
351
419
|
adUnitId: options.adId,
|
|
352
420
|
};
|
|
353
421
|
}
|
|
354
|
-
async showRewardVideoAd() {
|
|
422
|
+
async showRewardVideoAd(options) {
|
|
423
|
+
console.log('showRewardVideoAd', options);
|
|
355
424
|
return {
|
|
356
425
|
type: '',
|
|
357
426
|
amount: 0,
|
|
358
427
|
};
|
|
359
428
|
}
|
|
360
429
|
async prepareRewardInterstitialAd(options) {
|
|
361
|
-
console.log(options);
|
|
430
|
+
console.log('prepareRewardInterstitialAd', options);
|
|
362
431
|
return {
|
|
363
432
|
adUnitId: options.adId,
|
|
364
433
|
};
|
|
365
434
|
}
|
|
366
|
-
async showRewardInterstitialAd() {
|
|
435
|
+
async showRewardInterstitialAd(options) {
|
|
436
|
+
console.log('showRewardInterstitialAd', options);
|
|
367
437
|
return {
|
|
368
438
|
type: '',
|
|
369
439
|
amount: 0,
|
|
370
440
|
};
|
|
371
441
|
}
|
|
442
|
+
async loadAppOpen(options) {
|
|
443
|
+
console.log('loadAppOpen', options);
|
|
444
|
+
return {
|
|
445
|
+
adUnitId: options.adId,
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
async showAppOpen(options) {
|
|
449
|
+
console.log('showAppOpen', options);
|
|
450
|
+
}
|
|
451
|
+
async isAppOpenLoaded() {
|
|
452
|
+
return { value: false };
|
|
453
|
+
}
|
|
454
|
+
addListener(eventName, listenerFunc) {
|
|
455
|
+
console.log('addListener', eventName);
|
|
456
|
+
return Promise.resolve({ remove: () => Promise.resolve() });
|
|
457
|
+
}
|
|
372
458
|
}
|
|
373
459
|
|
|
374
460
|
var web = /*#__PURE__*/Object.freeze({
|