@ququplay/admob 5.3.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/CapacitorCommunityAdmob.podspec +19 -0
- package/LICENSE +21 -0
- package/README.md +1091 -0
- package/android/build.gradle +92 -0
- package/android/src/main/AndroidManifest.xml +5 -0
- package/android/src/main/java/com/getcapacitor/community/admob/AdMob.java +240 -0
- package/android/src/main/java/com/getcapacitor/community/admob/banner/BannerAdPluginEvents.kt +11 -0
- package/android/src/main/java/com/getcapacitor/community/admob/banner/BannerAdSizeEnum.kt +20 -0
- package/android/src/main/java/com/getcapacitor/community/admob/banner/BannerAdSizeInfo.kt +17 -0
- package/android/src/main/java/com/getcapacitor/community/admob/banner/BannerExecutor.java +294 -0
- package/android/src/main/java/com/getcapacitor/community/admob/consent/AdConsentExecutor.java +232 -0
- package/android/src/main/java/com/getcapacitor/community/admob/helpers/AdViewIdHelper.java +31 -0
- package/android/src/main/java/com/getcapacitor/community/admob/helpers/AuthorizationStatusEnum.kt +5 -0
- package/android/src/main/java/com/getcapacitor/community/admob/helpers/FullscreenPluginCallback.kt +27 -0
- package/android/src/main/java/com/getcapacitor/community/admob/helpers/RequestHelper.java +49 -0
- package/android/src/main/java/com/getcapacitor/community/admob/interstitial/AdInterstitialExecutor.java +80 -0
- package/android/src/main/java/com/getcapacitor/community/admob/interstitial/InterstitialAdCallbackAndListeners.kt +38 -0
- package/android/src/main/java/com/getcapacitor/community/admob/interstitial/InterstitialAdPluginPluginEvent.kt +11 -0
- package/android/src/main/java/com/getcapacitor/community/admob/models/AdMobPluginError.kt +15 -0
- package/android/src/main/java/com/getcapacitor/community/admob/models/AdOptions.java +225 -0
- package/android/src/main/java/com/getcapacitor/community/admob/models/Executor.java +34 -0
- package/android/src/main/java/com/getcapacitor/community/admob/models/LoadPluginEventNames.kt +7 -0
- package/android/src/main/java/com/getcapacitor/community/admob/rewarded/AdRewardExecutor.java +80 -0
- package/android/src/main/java/com/getcapacitor/community/admob/rewarded/RewardAdPluginEvents.kt +12 -0
- package/android/src/main/java/com/getcapacitor/community/admob/rewarded/RewardedAdCallbackAndListeners.kt +63 -0
- package/android/src/main/java/com/getcapacitor/community/admob/rewarded/models/SsvInfo.kt +20 -0
- package/android/src/main/res/layout/bridge_layout_main.xml +15 -0
- package/android/src/main/res/values/colors.xml +3 -0
- package/android/src/main/res/values/strings.xml +2 -0
- package/android/src/main/res/values/styles.xml +3 -0
- package/dist/docs.json +2467 -0
- package/dist/esm/banner/banner-ad-options.interface.d.ts +25 -0
- package/dist/esm/banner/banner-ad-options.interface.js +2 -0
- package/dist/esm/banner/banner-ad-options.interface.js.map +1 -0
- package/dist/esm/banner/banner-ad-plugin-events.enum.d.ts +17 -0
- package/dist/esm/banner/banner-ad-plugin-events.enum.js +20 -0
- package/dist/esm/banner/banner-ad-plugin-events.enum.js.map +1 -0
- package/dist/esm/banner/banner-ad-position.enum.d.ts +17 -0
- package/dist/esm/banner/banner-ad-position.enum.js +19 -0
- package/dist/esm/banner/banner-ad-position.enum.js.map +1 -0
- package/dist/esm/banner/banner-ad-size.enum.d.ts +42 -0
- package/dist/esm/banner/banner-ad-size.enum.js +44 -0
- package/dist/esm/banner/banner-ad-size.enum.js.map +1 -0
- package/dist/esm/banner/banner-definitions.interface.d.ts +91 -0
- package/dist/esm/banner/banner-definitions.interface.js +2 -0
- package/dist/esm/banner/banner-definitions.interface.js.map +1 -0
- package/dist/esm/banner/banner-size.interface.d.ts +7 -0
- package/dist/esm/banner/banner-size.interface.js +2 -0
- package/dist/esm/banner/banner-size.interface.js.map +1 -0
- package/dist/esm/banner/index.d.ts +6 -0
- package/dist/esm/banner/index.js +7 -0
- package/dist/esm/banner/index.js.map +1 -0
- package/dist/esm/consent/consent-debug-geography.enum.d.ts +19 -0
- package/dist/esm/consent/consent-debug-geography.enum.js +21 -0
- package/dist/esm/consent/consent-debug-geography.enum.js.map +1 -0
- package/dist/esm/consent/consent-definition.interface.d.ts +26 -0
- package/dist/esm/consent/consent-definition.interface.js +2 -0
- package/dist/esm/consent/consent-definition.interface.js.map +1 -0
- package/dist/esm/consent/consent-info.interface.d.ts +13 -0
- package/dist/esm/consent/consent-info.interface.js +2 -0
- package/dist/esm/consent/consent-info.interface.js.map +1 -0
- package/dist/esm/consent/consent-request-options.interface.d.ts +20 -0
- package/dist/esm/consent/consent-request-options.interface.js +2 -0
- package/dist/esm/consent/consent-request-options.interface.js.map +1 -0
- package/dist/esm/consent/consent-status.enum.d.ts +23 -0
- package/dist/esm/consent/consent-status.enum.js +25 -0
- package/dist/esm/consent/consent-status.enum.js.map +1 -0
- package/dist/esm/consent/index.d.ts +5 -0
- package/dist/esm/consent/index.js +6 -0
- package/dist/esm/consent/index.js.map +1 -0
- package/dist/esm/definitions.d.ts +129 -0
- package/dist/esm/definitions.js +20 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +9 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/interstitial/index.d.ts +2 -0
- package/dist/esm/interstitial/index.js +3 -0
- package/dist/esm/interstitial/index.js.map +1 -0
- package/dist/esm/interstitial/interstitial-ad-plugin-events.enum.d.ts +22 -0
- package/dist/esm/interstitial/interstitial-ad-plugin-events.enum.js +25 -0
- package/dist/esm/interstitial/interstitial-ad-plugin-events.enum.js.map +1 -0
- package/dist/esm/interstitial/interstitial-definitions.interface.d.ts +27 -0
- package/dist/esm/interstitial/interstitial-definitions.interface.js +2 -0
- package/dist/esm/interstitial/interstitial-definitions.interface.js.map +1 -0
- package/dist/esm/private/validate-all-events-implemented.type.d.ts +12 -0
- package/dist/esm/private/validate-all-events-implemented.type.js +2 -0
- package/dist/esm/private/validate-all-events-implemented.type.js.map +1 -0
- package/dist/esm/reward/index.d.ts +4 -0
- package/dist/esm/reward/index.js +5 -0
- package/dist/esm/reward/index.js.map +1 -0
- package/dist/esm/reward/reward-ad-options.interface.d.ts +25 -0
- package/dist/esm/reward/reward-ad-options.interface.js +2 -0
- package/dist/esm/reward/reward-ad-options.interface.js.map +1 -0
- package/dist/esm/reward/reward-ad-plugin-events.enum.d.ts +32 -0
- package/dist/esm/reward/reward-ad-plugin-events.enum.js +35 -0
- package/dist/esm/reward/reward-ad-plugin-events.enum.js.map +1 -0
- package/dist/esm/reward/reward-definitions.interface.d.ts +30 -0
- package/dist/esm/reward/reward-definitions.interface.js +2 -0
- package/dist/esm/reward/reward-definitions.interface.js.map +1 -0
- package/dist/esm/reward/reward-item.interface.d.ts +14 -0
- package/dist/esm/reward/reward-item.interface.js +2 -0
- package/dist/esm/reward/reward-item.interface.js.map +1 -0
- package/dist/esm/shared/ad-load-info.interface.d.ts +3 -0
- package/dist/esm/shared/ad-load-info.interface.js +2 -0
- package/dist/esm/shared/ad-load-info.interface.js.map +1 -0
- package/dist/esm/shared/ad-options.interface.d.ts +35 -0
- package/dist/esm/shared/ad-options.interface.js +2 -0
- package/dist/esm/shared/ad-options.interface.js.map +1 -0
- package/dist/esm/shared/admob-error.interface.d.ts +14 -0
- package/dist/esm/shared/admob-error.interface.js +2 -0
- package/dist/esm/shared/admob-error.interface.js.map +1 -0
- package/dist/esm/shared/index.d.ts +3 -0
- package/dist/esm/shared/index.js +4 -0
- package/dist/esm/shared/index.js.map +1 -0
- package/dist/esm/shared/tracking-authorization-status.interface.d.ts +6 -0
- package/dist/esm/shared/tracking-authorization-status.interface.js +2 -0
- package/dist/esm/shared/tracking-authorization-status.interface.js.map +1 -0
- package/dist/esm/web.d.ts +25 -0
- package/dist/esm/web.js +83 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +307 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +310 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Plugin/Banner/BannerAdPluginEvents.swift +8 -0
- package/ios/Plugin/Banner/BannerAdSizeEnum.swift +10 -0
- package/ios/Plugin/Banner/BannerExecutor.swift +198 -0
- package/ios/Plugin/Consent/ConsentExecutor.swift +158 -0
- package/ios/Plugin/Helper/AuthorizationStatusEnum.swift +6 -0
- package/ios/Plugin/Info.plist +24 -0
- package/ios/Plugin/Interstitial/AdInterstitialExecutor.swift +65 -0
- package/ios/Plugin/Interstitial/InterstitialAdPluginEvents.swift +7 -0
- package/ios/Plugin/Models/FullScreenAdEventName.swift +12 -0
- package/ios/Plugin/Plugin.h +10 -0
- package/ios/Plugin/Plugin.m +23 -0
- package/ios/Plugin/Plugin.swift +275 -0
- package/ios/Plugin/Rewarded/AdRewardExecutor.swift +86 -0
- package/ios/Plugin/Rewarded/RewardAdPluginEvents.swift +8 -0
- package/package.json +108 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { BannerDefinitions } from './banner';
|
|
2
|
+
import type { AdmobConsentDefinitions } from './consent';
|
|
3
|
+
import type { InterstitialDefinitions } from './interstitial';
|
|
4
|
+
import type { RewardDefinitions } from './reward';
|
|
5
|
+
import type { TrackingAuthorizationStatusInterface } from './shared/tracking-authorization-status.interface';
|
|
6
|
+
declare type AdMobDefinitions = BannerDefinitions & RewardDefinitions & InterstitialDefinitions & AdmobConsentDefinitions;
|
|
7
|
+
export interface AdMobPlugin extends AdMobDefinitions {
|
|
8
|
+
/**
|
|
9
|
+
* Initialize AdMob with AdMobInitializationOptions
|
|
10
|
+
*
|
|
11
|
+
* @group Initialize
|
|
12
|
+
* @param options AdMobInitializationOptions
|
|
13
|
+
* @since 1.1.2
|
|
14
|
+
*/
|
|
15
|
+
initialize(options?: AdMobInitializationOptions): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Confirm requestTrackingAuthorization status (iOS >14)
|
|
18
|
+
*
|
|
19
|
+
* @see https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547038-trackingauthorizationstatus
|
|
20
|
+
* @since 3.1.0
|
|
21
|
+
*/
|
|
22
|
+
trackingAuthorizationStatus(): Promise<TrackingAuthorizationStatusInterface>;
|
|
23
|
+
/**
|
|
24
|
+
* request requestTrackingAuthorization (iOS >14).
|
|
25
|
+
* This is deprecated method. We recommend UMP Consent.
|
|
26
|
+
*
|
|
27
|
+
* @see https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547038-trackingauthorizationstatus
|
|
28
|
+
* @since 5.2.0
|
|
29
|
+
*/
|
|
30
|
+
requestTrackingAuthorization(): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Report application mute state to AdMob SDK
|
|
33
|
+
*
|
|
34
|
+
* @see https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547038-trackingauthorizationstatus
|
|
35
|
+
* @since 4.1.1
|
|
36
|
+
*/
|
|
37
|
+
setApplicationMuted(options: ApplicationMutedOptions): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Report application volume to AdMob SDK
|
|
40
|
+
*
|
|
41
|
+
* @see https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547038-trackingauthorizationstatus
|
|
42
|
+
* @since 4.1.1
|
|
43
|
+
*/
|
|
44
|
+
setApplicationVolume(options: ApplicationVolumeOptions): Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
export interface AdMobInitializationOptions {
|
|
47
|
+
/**
|
|
48
|
+
* An Array of devices IDs that will be marked as tested devices if {@link AdMobInitializationOptions.initializeForTesting} is true
|
|
49
|
+
* (Real Ads will be served to Testing devices, but they will not count as 'real').
|
|
50
|
+
*
|
|
51
|
+
* @see https://developers.google.com/admob/android/test-ads#enable_test_devices
|
|
52
|
+
* @since 1.2.0
|
|
53
|
+
*/
|
|
54
|
+
testingDevices?: string[];
|
|
55
|
+
/**
|
|
56
|
+
* If set to true, the devices on {@link AdMobInitializationOptions.testingDevices} will
|
|
57
|
+
* be registered to receive test production ads.
|
|
58
|
+
*
|
|
59
|
+
* @see AdMobInitializationOptions.testingDevices
|
|
60
|
+
* @default false
|
|
61
|
+
* @since 1.2.0
|
|
62
|
+
*/
|
|
63
|
+
initializeForTesting?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* For purposes of the Children's Online Privacy Protection Act (COPPA),
|
|
66
|
+
* there is a setting called tagForChildDirectedTreatment.
|
|
67
|
+
*
|
|
68
|
+
* @see https://developers.google.com/admob/android/targeting#child-directed_setting
|
|
69
|
+
* @since 3.1.0
|
|
70
|
+
*/
|
|
71
|
+
tagForChildDirectedTreatment?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* When using this feature,
|
|
74
|
+
* a Tag For Users under the Age of Consent in Europe (TFUA) parameter will be included in all future ad requests.
|
|
75
|
+
*
|
|
76
|
+
* @see https://developers.google.com/admob/android/targeting#users_under_the_age_of_consent
|
|
77
|
+
* @since 3.1.0
|
|
78
|
+
*/
|
|
79
|
+
tagForUnderAgeOfConsent?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* As an app developer,
|
|
82
|
+
* you can indicate whether you want Google to treat your content as child-directed when you make an ad request.
|
|
83
|
+
*
|
|
84
|
+
* @see https://developers.google.com/admob/android/targeting#child-directed_setting
|
|
85
|
+
* @since 3.1.0
|
|
86
|
+
*/
|
|
87
|
+
maxAdContentRating?: MaxAdContentRating;
|
|
88
|
+
}
|
|
89
|
+
export declare enum MaxAdContentRating {
|
|
90
|
+
/**
|
|
91
|
+
* Content suitable for general audiences, including families.
|
|
92
|
+
*/
|
|
93
|
+
General = "General",
|
|
94
|
+
/**
|
|
95
|
+
* Content suitable for most audiences with parental guidance.
|
|
96
|
+
*/
|
|
97
|
+
ParentalGuidance = "ParentalGuidance",
|
|
98
|
+
/**
|
|
99
|
+
* Content suitable for teen and older audiences.
|
|
100
|
+
*/
|
|
101
|
+
Teen = "Teen",
|
|
102
|
+
/**
|
|
103
|
+
* Content suitable only for mature audiences.
|
|
104
|
+
*/
|
|
105
|
+
MatureAudience = "MatureAudience"
|
|
106
|
+
}
|
|
107
|
+
export interface ApplicationMutedOptions {
|
|
108
|
+
/**
|
|
109
|
+
* To inform the SDK that the app volume has been muted.
|
|
110
|
+
* Note: Video ads that are ineligible to be shown with muted audio are not returned for ad requests made,
|
|
111
|
+
* when the app volume is reported as muted or set to a value of 0. This may restrict a subset of the broader video ads pool from serving.
|
|
112
|
+
*
|
|
113
|
+
* @see https://developers.google.com/admob/android/global-settings
|
|
114
|
+
* @since 4.1.1
|
|
115
|
+
*/
|
|
116
|
+
muted?: boolean;
|
|
117
|
+
}
|
|
118
|
+
export interface ApplicationVolumeOptions {
|
|
119
|
+
/**
|
|
120
|
+
* If your app has its own volume controls (such as custom music or sound effect volumes),
|
|
121
|
+
* disclosing app volume to the Google Mobile Ads SDK allows video ads to respect app volume settings.
|
|
122
|
+
* enable set 0.0 - 1.0, any float allowed.
|
|
123
|
+
*
|
|
124
|
+
* @see https://developers.google.com/admob/android/global-settings
|
|
125
|
+
* @since 4.1.1
|
|
126
|
+
*/
|
|
127
|
+
volume?: 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1.0;
|
|
128
|
+
}
|
|
129
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export var MaxAdContentRating;
|
|
2
|
+
(function (MaxAdContentRating) {
|
|
3
|
+
/**
|
|
4
|
+
* Content suitable for general audiences, including families.
|
|
5
|
+
*/
|
|
6
|
+
MaxAdContentRating["General"] = "General";
|
|
7
|
+
/**
|
|
8
|
+
* Content suitable for most audiences with parental guidance.
|
|
9
|
+
*/
|
|
10
|
+
MaxAdContentRating["ParentalGuidance"] = "ParentalGuidance";
|
|
11
|
+
/**
|
|
12
|
+
* Content suitable for teen and older audiences.
|
|
13
|
+
*/
|
|
14
|
+
MaxAdContentRating["Teen"] = "Teen";
|
|
15
|
+
/**
|
|
16
|
+
* Content suitable only for mature audiences.
|
|
17
|
+
*/
|
|
18
|
+
MaxAdContentRating["MatureAudience"] = "MatureAudience";
|
|
19
|
+
})(MaxAdContentRating || (MaxAdContentRating = {}));
|
|
20
|
+
//# sourceMappingURL=definitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAuGA,MAAM,CAAN,IAAY,kBAoBX;AApBD,WAAY,kBAAkB;IAC5B;;OAEG;IACH,yCAAmB,CAAA;IAEnB;;OAEG;IACH,2DAAqC,CAAA;IAErC;;OAEG;IACH,mCAAa,CAAA;IAEb;;OAEG;IACH,uDAAiC,CAAA;AACnC,CAAC,EApBW,kBAAkB,KAAlB,kBAAkB,QAoB7B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AdMobPlugin } from './definitions';
|
|
2
|
+
declare const AdMob: AdMobPlugin;
|
|
3
|
+
export * from './definitions';
|
|
4
|
+
export * from './banner/index';
|
|
5
|
+
export * from './interstitial/index';
|
|
6
|
+
export * from './reward/index';
|
|
7
|
+
export * from './consent/index';
|
|
8
|
+
export * from './shared/index';
|
|
9
|
+
export { AdMob };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { registerPlugin } from '@capacitor/core';
|
|
2
|
+
const AdMob = registerPlugin('AdMob', {
|
|
3
|
+
web: () => import('./web').then(m => new m.AdMobWeb()),
|
|
4
|
+
});
|
|
5
|
+
export * from './definitions';
|
|
6
|
+
export * from './banner/index';
|
|
7
|
+
export * from './interstitial/index';
|
|
8
|
+
export * from './reward/index';
|
|
9
|
+
export * from './consent/index';
|
|
10
|
+
export * from './shared/index';
|
|
11
|
+
export { AdMob };
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,KAAK,GAAG,cAAc,CAAc,OAAO,EAAE;IACjD,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;CACvD,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interstitial/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare enum InterstitialAdPluginEvents {
|
|
2
|
+
/**
|
|
3
|
+
* Emits after trying to prepare and Interstitial, when it is loaded and ready to be show
|
|
4
|
+
*/
|
|
5
|
+
Loaded = "interstitialAdLoaded",
|
|
6
|
+
/**
|
|
7
|
+
* Emits after trying to prepare and Interstitial, when it could not be loaded
|
|
8
|
+
*/
|
|
9
|
+
FailedToLoad = "interstitialAdFailedToLoad",
|
|
10
|
+
/**
|
|
11
|
+
* Emits when the Interstitial ad is visible to the user
|
|
12
|
+
*/
|
|
13
|
+
Showed = "interstitialAdShowed",
|
|
14
|
+
/**
|
|
15
|
+
* Emits when the Interstitial ad is failed to show
|
|
16
|
+
*/
|
|
17
|
+
FailedToShow = "interstitialAdFailedToShow",
|
|
18
|
+
/**
|
|
19
|
+
* Emits when the Interstitial ad is not visible to the user anymore.
|
|
20
|
+
*/
|
|
21
|
+
Dismissed = "interstitialAdDismissed"
|
|
22
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// This enum should be keep in sync with their native equivalents with the same name
|
|
2
|
+
export var InterstitialAdPluginEvents;
|
|
3
|
+
(function (InterstitialAdPluginEvents) {
|
|
4
|
+
/**
|
|
5
|
+
* Emits after trying to prepare and Interstitial, when it is loaded and ready to be show
|
|
6
|
+
*/
|
|
7
|
+
InterstitialAdPluginEvents["Loaded"] = "interstitialAdLoaded";
|
|
8
|
+
/**
|
|
9
|
+
* Emits after trying to prepare and Interstitial, when it could not be loaded
|
|
10
|
+
*/
|
|
11
|
+
InterstitialAdPluginEvents["FailedToLoad"] = "interstitialAdFailedToLoad";
|
|
12
|
+
/**
|
|
13
|
+
* Emits when the Interstitial ad is visible to the user
|
|
14
|
+
*/
|
|
15
|
+
InterstitialAdPluginEvents["Showed"] = "interstitialAdShowed";
|
|
16
|
+
/**
|
|
17
|
+
* Emits when the Interstitial ad is failed to show
|
|
18
|
+
*/
|
|
19
|
+
InterstitialAdPluginEvents["FailedToShow"] = "interstitialAdFailedToShow";
|
|
20
|
+
/**
|
|
21
|
+
* Emits when the Interstitial ad is not visible to the user anymore.
|
|
22
|
+
*/
|
|
23
|
+
InterstitialAdPluginEvents["Dismissed"] = "interstitialAdDismissed";
|
|
24
|
+
})(InterstitialAdPluginEvents || (InterstitialAdPluginEvents = {}));
|
|
25
|
+
//# sourceMappingURL=interstitial-ad-plugin-events.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interstitial-ad-plugin-events.enum.js","sourceRoot":"","sources":["../../../src/interstitial/interstitial-ad-plugin-events.enum.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,MAAM,CAAN,IAAY,0BAqBX;AArBD,WAAY,0BAA0B;IACpC;;OAEG;IACH,6DAA+B,CAAA;IAC/B;;OAEG;IACH,yEAA2C,CAAA;IAC3C;;OAEG;IACH,6DAA+B,CAAA;IAC/B;;OAEG;IACH,yEAA2C,CAAA;IAC3C;;OAEG;IACH,mEAAoC,CAAA;AACtC,CAAC,EArBW,0BAA0B,KAA1B,0BAA0B,QAqBrC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { PluginListenerHandle } from '@capacitor/core';
|
|
2
|
+
import type { ValidateAllEventsEnumAreImplemented } from '../private/validate-all-events-implemented.type';
|
|
3
|
+
import type { AdLoadInfo, AdMobError, AdOptions } from '../shared';
|
|
4
|
+
import type { InterstitialAdPluginEvents } from './interstitial-ad-plugin-events.enum';
|
|
5
|
+
export declare type InterstitialDefinitionsHasAllEvents = ValidateAllEventsEnumAreImplemented<InterstitialAdPluginEvents, InterstitialDefinitions>;
|
|
6
|
+
export interface InterstitialDefinitions {
|
|
7
|
+
/**
|
|
8
|
+
* Prepare interstitial banner
|
|
9
|
+
*
|
|
10
|
+
* @group Interstitial
|
|
11
|
+
* @param options AdOptions
|
|
12
|
+
* @since 1.1.2
|
|
13
|
+
*/
|
|
14
|
+
prepareInterstitial(options: AdOptions): Promise<AdLoadInfo>;
|
|
15
|
+
/**
|
|
16
|
+
* Show interstitial ad when it’s ready
|
|
17
|
+
*
|
|
18
|
+
* @group Interstitial
|
|
19
|
+
* @since 1.1.2
|
|
20
|
+
*/
|
|
21
|
+
showInterstitial(): Promise<void>;
|
|
22
|
+
addListener(eventName: InterstitialAdPluginEvents.FailedToLoad, listenerFunc: (error: AdMobError) => void): PluginListenerHandle;
|
|
23
|
+
addListener(eventName: InterstitialAdPluginEvents.Loaded, listenerFunc: (info: AdLoadInfo) => void): PluginListenerHandle;
|
|
24
|
+
addListener(eventName: InterstitialAdPluginEvents.Dismissed, listenerFunc: () => void): PluginListenerHandle;
|
|
25
|
+
addListener(eventName: InterstitialAdPluginEvents.FailedToShow, listenerFunc: (error: AdMobError) => void): PluginListenerHandle;
|
|
26
|
+
addListener(eventName: InterstitialAdPluginEvents.Showed, listenerFunc: () => void): PluginListenerHandle;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interstitial-definitions.interface.js","sourceRoot":"","sources":["../../../src/interstitial/interstitial-definitions.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PluginListenerHandle } from '@capacitor/core';
|
|
2
|
+
declare type Contra<T> = (x: T) => void;
|
|
3
|
+
declare type UnwrapContra<T> = [T] extends [Contra<infer S>] ? S : never;
|
|
4
|
+
declare type UnionToIntersection<U> = UnwrapContra<U extends any ? Contra<U> : never>;
|
|
5
|
+
declare type Overload<T> = (eventName: T, listenerFunc: (...args: any[]) => any) => PluginListenerHandle;
|
|
6
|
+
declare type OverloadUnionForEnum<T> = T extends any ? Overload<T> : never;
|
|
7
|
+
declare type OverloadUnion<T> = OverloadUnionForEnum<T>;
|
|
8
|
+
declare type Overloads<T> = UnionToIntersection<OverloadUnion<T>>;
|
|
9
|
+
export declare type ValidateAllEventsEnumAreImplemented<TEventsEnum, TDefinitionInterface extends {
|
|
10
|
+
addListener: Overloads<TEventsEnum>;
|
|
11
|
+
}> = TDefinitionInterface;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-all-events-implemented.type.js","sourceRoot":"","sources":["../../../src/private/validate-all-events-implemented.type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/reward/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AdOptions } from '../shared/ad-options.interface';
|
|
2
|
+
declare type AtLeastOne<T> = {
|
|
3
|
+
[K in keyof T]: Pick<T, K>;
|
|
4
|
+
}[keyof T];
|
|
5
|
+
export interface RewardAdOptions extends AdOptions {
|
|
6
|
+
/**
|
|
7
|
+
* If you have enabled SSV in your AdMob Application. You can provide customData or
|
|
8
|
+
* a userId be passed to your callback to do further processing on.
|
|
9
|
+
*
|
|
10
|
+
* *Important* You *HAVE* to define one of them.
|
|
11
|
+
*
|
|
12
|
+
* @see https://support.google.com/admob/answer/9603226?hl=en-GB
|
|
13
|
+
*/
|
|
14
|
+
ssv?: AtLeastOne<{
|
|
15
|
+
/**
|
|
16
|
+
* An optional UserId to pass to your SSV callback function.
|
|
17
|
+
*/
|
|
18
|
+
userId: string;
|
|
19
|
+
/**
|
|
20
|
+
* An optional custom set of data to pass to your SSV callback function.
|
|
21
|
+
*/
|
|
22
|
+
customData: string;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reward-ad-options.interface.js","sourceRoot":"","sources":["../../../src/reward/reward-ad-options.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare enum RewardAdPluginEvents {
|
|
2
|
+
/**
|
|
3
|
+
* Emits after trying to prepare a RewardAd and the Video is loaded and ready to be show
|
|
4
|
+
*/
|
|
5
|
+
Loaded = "onRewardedVideoAdLoaded",
|
|
6
|
+
/**
|
|
7
|
+
* Emits after trying to prepare a RewardAd when it could not be loaded
|
|
8
|
+
*/
|
|
9
|
+
FailedToLoad = "onRewardedVideoAdFailedToLoad",
|
|
10
|
+
/**
|
|
11
|
+
* Emits when the AdReward video is visible to the user
|
|
12
|
+
*/
|
|
13
|
+
Showed = "onRewardedVideoAdShowed",
|
|
14
|
+
/**
|
|
15
|
+
* Emits when the AdReward video is failed to show
|
|
16
|
+
*/
|
|
17
|
+
FailedToShow = "onRewardedVideoAdFailedToShow",
|
|
18
|
+
/**
|
|
19
|
+
* Emits when the AdReward video is not visible to the user anymore.
|
|
20
|
+
*
|
|
21
|
+
* **Important**: This has nothing to do with the reward it self. This event
|
|
22
|
+
* will emits in this two cases:
|
|
23
|
+
* 1. The user starts the video ad but close it before the reward emit.
|
|
24
|
+
* 2. The user start the video and see it until end, then gets the reward
|
|
25
|
+
* and after that the ad is closed.
|
|
26
|
+
*/
|
|
27
|
+
Dismissed = "onRewardedVideoAdDismissed",
|
|
28
|
+
/**
|
|
29
|
+
* Emits when user get rewarded from AdReward
|
|
30
|
+
*/
|
|
31
|
+
Rewarded = "onRewardedVideoAdReward"
|
|
32
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// This enum should be keep in sync with their native equivalents with the same name
|
|
2
|
+
export var RewardAdPluginEvents;
|
|
3
|
+
(function (RewardAdPluginEvents) {
|
|
4
|
+
/**
|
|
5
|
+
* Emits after trying to prepare a RewardAd and the Video is loaded and ready to be show
|
|
6
|
+
*/
|
|
7
|
+
RewardAdPluginEvents["Loaded"] = "onRewardedVideoAdLoaded";
|
|
8
|
+
/**
|
|
9
|
+
* Emits after trying to prepare a RewardAd when it could not be loaded
|
|
10
|
+
*/
|
|
11
|
+
RewardAdPluginEvents["FailedToLoad"] = "onRewardedVideoAdFailedToLoad";
|
|
12
|
+
/**
|
|
13
|
+
* Emits when the AdReward video is visible to the user
|
|
14
|
+
*/
|
|
15
|
+
RewardAdPluginEvents["Showed"] = "onRewardedVideoAdShowed";
|
|
16
|
+
/**
|
|
17
|
+
* Emits when the AdReward video is failed to show
|
|
18
|
+
*/
|
|
19
|
+
RewardAdPluginEvents["FailedToShow"] = "onRewardedVideoAdFailedToShow";
|
|
20
|
+
/**
|
|
21
|
+
* Emits when the AdReward video is not visible to the user anymore.
|
|
22
|
+
*
|
|
23
|
+
* **Important**: This has nothing to do with the reward it self. This event
|
|
24
|
+
* will emits in this two cases:
|
|
25
|
+
* 1. The user starts the video ad but close it before the reward emit.
|
|
26
|
+
* 2. The user start the video and see it until end, then gets the reward
|
|
27
|
+
* and after that the ad is closed.
|
|
28
|
+
*/
|
|
29
|
+
RewardAdPluginEvents["Dismissed"] = "onRewardedVideoAdDismissed";
|
|
30
|
+
/**
|
|
31
|
+
* Emits when user get rewarded from AdReward
|
|
32
|
+
*/
|
|
33
|
+
RewardAdPluginEvents["Rewarded"] = "onRewardedVideoAdReward";
|
|
34
|
+
})(RewardAdPluginEvents || (RewardAdPluginEvents = {}));
|
|
35
|
+
//# sourceMappingURL=reward-ad-plugin-events.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reward-ad-plugin-events.enum.js","sourceRoot":"","sources":["../../../src/reward/reward-ad-plugin-events.enum.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,MAAM,CAAN,IAAY,oBA+BX;AA/BD,WAAY,oBAAoB;IAC9B;;OAEG;IACH,0DAAkC,CAAA;IAClC;;OAEG;IACH,sEAA8C,CAAA;IAC9C;;OAEG;IACH,0DAAkC,CAAA;IAClC;;OAEG;IACH,sEAA8C,CAAA;IAC9C;;;;;;;;OAQG;IACH,gEAAuC,CAAA;IACvC;;OAEG;IACH,4DAAmC,CAAA;AACrC,CAAC,EA/BW,oBAAoB,KAApB,oBAAoB,QA+B/B"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { PluginListenerHandle } from '@capacitor/core';
|
|
2
|
+
import type { ValidateAllEventsEnumAreImplemented } from '../private/validate-all-events-implemented.type';
|
|
3
|
+
import type { AdLoadInfo, AdMobError } from '../shared';
|
|
4
|
+
import type { RewardAdOptions } from './reward-ad-options.interface';
|
|
5
|
+
import type { RewardAdPluginEvents } from './reward-ad-plugin-events.enum';
|
|
6
|
+
import type { AdMobRewardItem } from './reward-item.interface';
|
|
7
|
+
export declare type RewardDefinitionsHasAllEvents = ValidateAllEventsEnumAreImplemented<RewardAdPluginEvents, RewardDefinitions>;
|
|
8
|
+
export interface RewardDefinitions {
|
|
9
|
+
/**
|
|
10
|
+
* Prepare a reward video ad
|
|
11
|
+
*
|
|
12
|
+
* @group RewardVideo
|
|
13
|
+
* @param options RewardAdOptions
|
|
14
|
+
* @since 1.1.2
|
|
15
|
+
*/
|
|
16
|
+
prepareRewardVideoAd(options: RewardAdOptions): Promise<AdLoadInfo>;
|
|
17
|
+
/**
|
|
18
|
+
* Show a reward video ad
|
|
19
|
+
*
|
|
20
|
+
* @group RewardVideo
|
|
21
|
+
* @since 1.1.2
|
|
22
|
+
*/
|
|
23
|
+
showRewardVideoAd(): Promise<AdMobRewardItem>;
|
|
24
|
+
addListener(eventName: RewardAdPluginEvents.FailedToLoad, listenerFunc: (error: AdMobError) => void): PluginListenerHandle;
|
|
25
|
+
addListener(eventName: RewardAdPluginEvents.Loaded, listenerFunc: (info: AdLoadInfo) => void): PluginListenerHandle;
|
|
26
|
+
addListener(eventName: RewardAdPluginEvents.Rewarded, listenerFunc: (reward: AdMobRewardItem) => void): PluginListenerHandle;
|
|
27
|
+
addListener(eventName: RewardAdPluginEvents.Dismissed, listenerFunc: () => void): PluginListenerHandle;
|
|
28
|
+
addListener(eventName: RewardAdPluginEvents.FailedToShow, listenerFunc: (error: AdMobError) => void): PluginListenerHandle;
|
|
29
|
+
addListener(eventName: RewardAdPluginEvents.Showed, listenerFunc: () => void): PluginListenerHandle;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reward-definitions.interface.js","sourceRoot":"","sources":["../../../src/reward/reward-definitions.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* For more information
|
|
3
|
+
* https://developers.google.com/admob/android/rewarded-video-adapters?hl=en
|
|
4
|
+
*/
|
|
5
|
+
export interface AdMobRewardItem {
|
|
6
|
+
/**
|
|
7
|
+
* Rewarded type user got
|
|
8
|
+
*/
|
|
9
|
+
type: string;
|
|
10
|
+
/**
|
|
11
|
+
* Rewarded amount user got
|
|
12
|
+
*/
|
|
13
|
+
amount: number;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reward-item.interface.js","sourceRoot":"","sources":["../../../src/reward/reward-item.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ad-load-info.interface.js","sourceRoot":"","sources":["../../../src/shared/ad-load-info.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface AdOptions {
|
|
2
|
+
/**
|
|
3
|
+
* The ad unit ID that you want to request
|
|
4
|
+
*
|
|
5
|
+
* @see https://support.google.com/admob/answer/7356431?hl=en
|
|
6
|
+
* @since 1.1.2
|
|
7
|
+
*/
|
|
8
|
+
adId: string;
|
|
9
|
+
/**
|
|
10
|
+
* You can use test mode of ad.
|
|
11
|
+
*
|
|
12
|
+
* @default false
|
|
13
|
+
* @since 1.1.2
|
|
14
|
+
*/
|
|
15
|
+
isTesting?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Margin Banner. Default is 0px;
|
|
18
|
+
* If position is BOTTOM_CENTER, margin is be margin-bottom.
|
|
19
|
+
* If position is TOP_CENTER, margin is be margin-top.
|
|
20
|
+
*
|
|
21
|
+
* @default 0
|
|
22
|
+
* @since 1.1.2
|
|
23
|
+
*/
|
|
24
|
+
margin?: number;
|
|
25
|
+
/**
|
|
26
|
+
* The default behavior of the Google Mobile Ads SDK is to serve personalized ads.
|
|
27
|
+
* Set this to true to request Non-Personalized Ads
|
|
28
|
+
*
|
|
29
|
+
* @see https://developers.google.com/admob/ios/eu-consent
|
|
30
|
+
* @see https://developers.google.com/admob/android/eu-consent
|
|
31
|
+
* @default false
|
|
32
|
+
* @since 1.2.0
|
|
33
|
+
*/
|
|
34
|
+
npa?: boolean;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ad-options.interface.js","sourceRoot":"","sources":["../../../src/shared/ad-options.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* For more information
|
|
3
|
+
* https://developers.google.com/android/reference/com/google/android/gms/ads/AdError
|
|
4
|
+
*/
|
|
5
|
+
export interface AdMobError {
|
|
6
|
+
/**
|
|
7
|
+
* Gets the error's code.
|
|
8
|
+
*/
|
|
9
|
+
code: number;
|
|
10
|
+
/**
|
|
11
|
+
* Gets the message describing the error.
|
|
12
|
+
*/
|
|
13
|
+
message: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admob-error.interface.js","sourceRoot":"","sources":["../../../src/shared/admob-error.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracking-authorization-status.interface.js","sourceRoot":"","sources":["../../../src/shared/tracking-authorization-status.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
import type { AdMobPlugin, ApplicationMutedOptions, ApplicationVolumeOptions, AdmobConsentInfo, AdmobConsentRequestOptions } from '.';
|
|
3
|
+
import type { AdMobRewardItem } from './reward';
|
|
4
|
+
import type { AdOptions, AdLoadInfo } from './shared';
|
|
5
|
+
import type { TrackingAuthorizationStatusInterface } from './shared/tracking-authorization-status.interface';
|
|
6
|
+
export declare class AdMobWeb extends WebPlugin implements AdMobPlugin {
|
|
7
|
+
constructor();
|
|
8
|
+
initialize(): Promise<void>;
|
|
9
|
+
targetSettings(): Promise<void>;
|
|
10
|
+
requestTrackingAuthorization(): Promise<void>;
|
|
11
|
+
trackingAuthorizationStatus(): Promise<TrackingAuthorizationStatusInterface>;
|
|
12
|
+
requestConsentInfo(options?: AdmobConsentRequestOptions): Promise<AdmobConsentInfo>;
|
|
13
|
+
showConsentForm(): Promise<AdmobConsentInfo>;
|
|
14
|
+
resetConsentInfo(): Promise<void>;
|
|
15
|
+
setApplicationMuted(options: ApplicationMutedOptions): Promise<void>;
|
|
16
|
+
setApplicationVolume(options: ApplicationVolumeOptions): Promise<void>;
|
|
17
|
+
showBanner(options: AdOptions): Promise<void>;
|
|
18
|
+
hideBanner(): Promise<void>;
|
|
19
|
+
resumeBanner(): Promise<void>;
|
|
20
|
+
removeBanner(): Promise<void>;
|
|
21
|
+
prepareInterstitial(options: AdOptions): Promise<AdLoadInfo>;
|
|
22
|
+
showInterstitial(): Promise<void>;
|
|
23
|
+
prepareRewardVideoAd(options: AdOptions): Promise<AdLoadInfo>;
|
|
24
|
+
showRewardVideoAd(): Promise<AdMobRewardItem>;
|
|
25
|
+
}
|