@ququplay/admob 5.3.2 → 7.0.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/Package.swift +30 -0
- package/README.md +378 -150
- package/android/build.gradle +13 -13
- package/android/src/main/java/com/getcapacitor/community/admob/AdMob.java +17 -0
- package/android/src/main/java/com/getcapacitor/community/admob/banner/BannerExecutor.java +81 -91
- package/android/src/main/java/com/getcapacitor/community/admob/consent/AdConsentExecutor.java +45 -42
- package/android/src/main/java/com/getcapacitor/community/admob/interstitial/AdInterstitialExecutor.java +17 -21
- 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 +19 -23
- package/android/src/main/java/com/getcapacitor/community/admob/rewardedinterstitial/AdRewardInterstitialExecutor.java +80 -0
- package/android/src/main/java/com/getcapacitor/community/admob/rewardedinterstitial/RewardInterstitialAdPluginEvents.kt +12 -0
- package/android/src/main/java/com/getcapacitor/community/admob/rewardedinterstitial/RewardedInterstitialAdCallbackAndListeners.kt +50 -0
- package/android/src/main/java/com/getcapacitor/community/admob/rewardedinterstitial/models/SsvInfo.kt +20 -0
- package/dist/docs.json +433 -783
- package/dist/esm/banner/banner-definitions.interface.d.ts +18 -18
- package/dist/esm/definitions.d.ts +2 -1
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interstitial/interstitial-definitions.interface.d.ts +5 -5
- package/dist/esm/private/validate-all-events-implemented.type.d.ts +1 -1
- package/dist/esm/reward/reward-definitions.interface.d.ts +12 -12
- package/dist/esm/reward-interstitial/index.d.ts +4 -0
- package/dist/esm/reward-interstitial/index.js +5 -0
- package/dist/esm/reward-interstitial/index.js.map +1 -0
- package/dist/esm/reward-interstitial/reward-interstitial-ad-options.interface.d.ts +25 -0
- package/dist/esm/reward-interstitial/reward-interstitial-ad-options.interface.js +2 -0
- package/dist/esm/reward-interstitial/reward-interstitial-ad-options.interface.js.map +1 -0
- package/dist/esm/reward-interstitial/reward-interstitial-ad-plugin-events.enum.d.ts +32 -0
- package/dist/esm/reward-interstitial/reward-interstitial-ad-plugin-events.enum.js +35 -0
- package/dist/esm/reward-interstitial/reward-interstitial-ad-plugin-events.enum.js.map +1 -0
- package/dist/esm/reward-interstitial/reward-interstitial-definitions.interface.d.ts +30 -0
- package/dist/esm/reward-interstitial/reward-interstitial-definitions.interface.js +2 -0
- package/dist/esm/reward-interstitial/reward-interstitial-definitions.interface.js.map +1 -0
- package/dist/esm/reward-interstitial/reward-interstitial-item.interface.d.ts +14 -0
- package/dist/esm/reward-interstitial/reward-interstitial-item.interface.js +2 -0
- package/dist/esm/reward-interstitial/reward-interstitial-item.interface.js.map +1 -0
- package/dist/esm/web.d.ts +2 -2
- package/dist/esm/web.js +12 -9
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +48 -12
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +49 -13
- package/dist/plugin.js.map +1 -1
- package/ios/{Plugin/Plugin.swift → Sources/AdMobPlugin/AdMobPlugin.swift} +50 -8
- package/ios/{Plugin → Sources/AdMobPlugin}/Banner/BannerExecutor.swift +11 -23
- package/ios/{Plugin → Sources/AdMobPlugin}/Consent/ConsentExecutor.swift +1 -1
- package/ios/{Plugin → Sources/AdMobPlugin}/Interstitial/AdInterstitialExecutor.swift +4 -4
- package/ios/{Plugin → Sources/AdMobPlugin}/Rewarded/AdRewardExecutor.swift +4 -4
- package/ios/Sources/AdMobPlugin/RewardedInterstitial/AdRewardInterstitialExecutor.swift +86 -0
- package/ios/Sources/AdMobPlugin/RewardedInterstitial/RewardInterstitialAdPluginEvents.swift +8 -0
- package/ios/Tests/AdMobPluginTests/AdMobPluginTests.swift +15 -0
- package/package.json +31 -35
- package/QuquplayAdmob.podspec +0 -19
- package/ios/Plugin/Info.plist +0 -24
- package/ios/Plugin/Plugin.h +0 -10
- package/ios/Plugin/Plugin.m +0 -23
- /package/ios/{Plugin → Sources/AdMobPlugin}/Banner/BannerAdPluginEvents.swift +0 -0
- /package/ios/{Plugin → Sources/AdMobPlugin}/Banner/BannerAdSizeEnum.swift +0 -0
- /package/ios/{Plugin → Sources/AdMobPlugin}/Helper/AuthorizationStatusEnum.swift +0 -0
- /package/ios/{Plugin → Sources/AdMobPlugin}/Interstitial/InterstitialAdPluginEvents.swift +0 -0
- /package/ios/{Plugin → Sources/AdMobPlugin}/Models/FullScreenAdEventName.swift +0 -0
- /package/ios/{Plugin → Sources/AdMobPlugin}/Rewarded/RewardAdPluginEvents.swift +0 -0
|
@@ -7,12 +7,12 @@ import type { AdMobBannerSize } from './banner-size.interface';
|
|
|
7
7
|
export declare type BannerDefinitionsHasAllEvents = ValidateAllEventsEnumAreImplemented<BannerAdPluginEvents, BannerDefinitions>;
|
|
8
8
|
export interface BannerDefinitions {
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
* Show a banner Ad
|
|
11
|
+
*
|
|
12
|
+
* @group Banner
|
|
13
|
+
* @param options AdOptions
|
|
14
|
+
* @since 1.1.2
|
|
15
|
+
*/
|
|
16
16
|
showBanner(options: BannerAdOptions): Promise<void>;
|
|
17
17
|
/**
|
|
18
18
|
* Hide the banner, remove it from screen, but can show it later
|
|
@@ -36,13 +36,13 @@ export interface BannerDefinitions {
|
|
|
36
36
|
*/
|
|
37
37
|
removeBanner(): Promise<void>;
|
|
38
38
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
addListener(eventName: BannerAdPluginEvents.SizeChanged, listenerFunc: (info: AdMobBannerSize) => void): PluginListenerHandle
|
|
39
|
+
*
|
|
40
|
+
* @group Banner
|
|
41
|
+
* @param eventName bannerAdSizeChanged
|
|
42
|
+
* @param listenerFunc
|
|
43
|
+
* @since 3.0.0
|
|
44
|
+
*/
|
|
45
|
+
addListener(eventName: BannerAdPluginEvents.SizeChanged, listenerFunc: (info: AdMobBannerSize) => void): Promise<PluginListenerHandle>;
|
|
46
46
|
/**
|
|
47
47
|
* Notice: request loaded Banner ad
|
|
48
48
|
*
|
|
@@ -51,7 +51,7 @@ export interface BannerDefinitions {
|
|
|
51
51
|
* @param listenerFunc
|
|
52
52
|
* @since 3.0.0
|
|
53
53
|
*/
|
|
54
|
-
addListener(eventName: BannerAdPluginEvents.Loaded, listenerFunc: () => void): PluginListenerHandle
|
|
54
|
+
addListener(eventName: BannerAdPluginEvents.Loaded, listenerFunc: () => void): Promise<PluginListenerHandle>;
|
|
55
55
|
/**
|
|
56
56
|
* Notice: request failed Banner ad
|
|
57
57
|
*
|
|
@@ -60,7 +60,7 @@ export interface BannerDefinitions {
|
|
|
60
60
|
* @param listenerFunc
|
|
61
61
|
* @since 3.0.0
|
|
62
62
|
*/
|
|
63
|
-
addListener(eventName: BannerAdPluginEvents.FailedToLoad, listenerFunc: (info: AdMobError) => void): PluginListenerHandle
|
|
63
|
+
addListener(eventName: BannerAdPluginEvents.FailedToLoad, listenerFunc: (info: AdMobError) => void): Promise<PluginListenerHandle>;
|
|
64
64
|
/**
|
|
65
65
|
* Notice: full-screen banner view will be presented in response to the user clicking on an ad.
|
|
66
66
|
*
|
|
@@ -69,7 +69,7 @@ export interface BannerDefinitions {
|
|
|
69
69
|
* @param listenerFunc
|
|
70
70
|
* @since 3.0.0
|
|
71
71
|
*/
|
|
72
|
-
addListener(eventName: BannerAdPluginEvents.Opened, listenerFunc: () => void): PluginListenerHandle
|
|
72
|
+
addListener(eventName: BannerAdPluginEvents.Opened, listenerFunc: () => void): Promise<PluginListenerHandle>;
|
|
73
73
|
/**
|
|
74
74
|
* Notice: The full-screen banner view will been dismissed.
|
|
75
75
|
*
|
|
@@ -78,7 +78,7 @@ export interface BannerDefinitions {
|
|
|
78
78
|
* @param listenerFunc
|
|
79
79
|
* @since 3.0.0
|
|
80
80
|
*/
|
|
81
|
-
addListener(eventName: BannerAdPluginEvents.Closed, listenerFunc: () => void): PluginListenerHandle
|
|
81
|
+
addListener(eventName: BannerAdPluginEvents.Closed, listenerFunc: () => void): Promise<PluginListenerHandle>;
|
|
82
82
|
/**
|
|
83
83
|
* Unimplemented
|
|
84
84
|
*
|
|
@@ -87,5 +87,5 @@ export interface BannerDefinitions {
|
|
|
87
87
|
* @param listenerFunc
|
|
88
88
|
* @since 3.0.0
|
|
89
89
|
*/
|
|
90
|
-
addListener(eventName: BannerAdPluginEvents.AdImpression, listenerFunc: () => void): PluginListenerHandle
|
|
90
|
+
addListener(eventName: BannerAdPluginEvents.AdImpression, listenerFunc: () => void): Promise<PluginListenerHandle>;
|
|
91
91
|
}
|
|
@@ -2,8 +2,9 @@ import type { BannerDefinitions } from './banner';
|
|
|
2
2
|
import type { AdmobConsentDefinitions } from './consent';
|
|
3
3
|
import type { InterstitialDefinitions } from './interstitial';
|
|
4
4
|
import type { RewardDefinitions } from './reward';
|
|
5
|
+
import type { RewardInterstitialDefinitions } from './reward-interstitial';
|
|
5
6
|
import type { TrackingAuthorizationStatusInterface } from './shared/tracking-authorization-status.interface';
|
|
6
|
-
declare type AdMobDefinitions = BannerDefinitions & RewardDefinitions & InterstitialDefinitions & AdmobConsentDefinitions;
|
|
7
|
+
declare type AdMobDefinitions = BannerDefinitions & RewardDefinitions & RewardInterstitialDefinitions & InterstitialDefinitions & AdmobConsentDefinitions;
|
|
7
8
|
export interface AdMobPlugin extends AdMobDefinitions {
|
|
8
9
|
/**
|
|
9
10
|
* Initialize AdMob with AdMobInitializationOptions
|
|
@@ -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":"AAyGA,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"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ declare const AdMob: AdMobPlugin;
|
|
|
3
3
|
export * from './definitions';
|
|
4
4
|
export * from './banner/index';
|
|
5
5
|
export * from './interstitial/index';
|
|
6
|
+
export * from './reward-interstitial/index';
|
|
6
7
|
export * from './reward/index';
|
|
7
8
|
export * from './consent/index';
|
|
8
9
|
export * from './shared/index';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { registerPlugin } from '@capacitor/core';
|
|
2
2
|
const AdMob = registerPlugin('AdMob', {
|
|
3
|
-
web: () => import('./web').then(m => new m.AdMobWeb()),
|
|
3
|
+
web: () => import('./web').then((m) => new m.AdMobWeb()),
|
|
4
4
|
});
|
|
5
5
|
export * from './definitions';
|
|
6
6
|
export * from './banner/index';
|
|
7
7
|
export * from './interstitial/index';
|
|
8
|
+
export * from './reward-interstitial/index';
|
|
8
9
|
export * from './reward/index';
|
|
9
10
|
export * from './consent/index';
|
|
10
11
|
export * from './shared/index';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +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;
|
|
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,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;CACzD,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -19,9 +19,9 @@ export interface InterstitialDefinitions {
|
|
|
19
19
|
* @since 1.1.2
|
|
20
20
|
*/
|
|
21
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
|
|
22
|
+
addListener(eventName: InterstitialAdPluginEvents.FailedToLoad, listenerFunc: (error: AdMobError) => void): Promise<PluginListenerHandle>;
|
|
23
|
+
addListener(eventName: InterstitialAdPluginEvents.Loaded, listenerFunc: (info: AdLoadInfo) => void): Promise<PluginListenerHandle>;
|
|
24
|
+
addListener(eventName: InterstitialAdPluginEvents.Dismissed, listenerFunc: () => void): Promise<PluginListenerHandle>;
|
|
25
|
+
addListener(eventName: InterstitialAdPluginEvents.FailedToShow, listenerFunc: (error: AdMobError) => void): Promise<PluginListenerHandle>;
|
|
26
|
+
addListener(eventName: InterstitialAdPluginEvents.Showed, listenerFunc: () => void): Promise<PluginListenerHandle>;
|
|
27
27
|
}
|
|
@@ -2,7 +2,7 @@ import type { PluginListenerHandle } from '@capacitor/core';
|
|
|
2
2
|
declare type Contra<T> = (x: T) => void;
|
|
3
3
|
declare type UnwrapContra<T> = [T] extends [Contra<infer S>] ? S : never;
|
|
4
4
|
declare type UnionToIntersection<U> = UnwrapContra<U extends any ? Contra<U> : never>;
|
|
5
|
-
declare type Overload<T> = (eventName: T, listenerFunc: (...args: any[]) => any) => PluginListenerHandle
|
|
5
|
+
declare type Overload<T> = (eventName: T, listenerFunc: (...args: any[]) => any) => Promise<PluginListenerHandle>;
|
|
6
6
|
declare type OverloadUnionForEnum<T> = T extends any ? Overload<T> : never;
|
|
7
7
|
declare type OverloadUnion<T> = OverloadUnionForEnum<T>;
|
|
8
8
|
declare type Overloads<T> = UnionToIntersection<OverloadUnion<T>>;
|
|
@@ -7,12 +7,12 @@ import type { AdMobRewardItem } from './reward-item.interface';
|
|
|
7
7
|
export declare type RewardDefinitionsHasAllEvents = ValidateAllEventsEnumAreImplemented<RewardAdPluginEvents, RewardDefinitions>;
|
|
8
8
|
export interface RewardDefinitions {
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
* Prepare a reward video ad
|
|
11
|
+
*
|
|
12
|
+
* @group RewardVideo
|
|
13
|
+
* @param options RewardAdOptions
|
|
14
|
+
* @since 1.1.2
|
|
15
|
+
*/
|
|
16
16
|
prepareRewardVideoAd(options: RewardAdOptions): Promise<AdLoadInfo>;
|
|
17
17
|
/**
|
|
18
18
|
* Show a reward video ad
|
|
@@ -21,10 +21,10 @@ export interface RewardDefinitions {
|
|
|
21
21
|
* @since 1.1.2
|
|
22
22
|
*/
|
|
23
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
|
|
24
|
+
addListener(eventName: RewardAdPluginEvents.FailedToLoad, listenerFunc: (error: AdMobError) => void): Promise<PluginListenerHandle>;
|
|
25
|
+
addListener(eventName: RewardAdPluginEvents.Loaded, listenerFunc: (info: AdLoadInfo) => void): Promise<PluginListenerHandle>;
|
|
26
|
+
addListener(eventName: RewardAdPluginEvents.Rewarded, listenerFunc: (reward: AdMobRewardItem) => void): Promise<PluginListenerHandle>;
|
|
27
|
+
addListener(eventName: RewardAdPluginEvents.Dismissed, listenerFunc: () => void): Promise<PluginListenerHandle>;
|
|
28
|
+
addListener(eventName: RewardAdPluginEvents.FailedToShow, listenerFunc: (error: AdMobError) => void): Promise<PluginListenerHandle>;
|
|
29
|
+
addListener(eventName: RewardAdPluginEvents.Showed, listenerFunc: () => void): Promise<PluginListenerHandle>;
|
|
30
30
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from './reward-interstitial-ad-plugin-events.enum';
|
|
2
|
+
export * from './reward-interstitial-definitions.interface';
|
|
3
|
+
export * from './reward-interstitial-item.interface';
|
|
4
|
+
export * from './reward-interstitial-ad-options.interface';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/reward-interstitial/index.ts"],"names":[],"mappings":"AAAA,cAAc,6CAA6C,CAAC;AAC5D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,sCAAsC,CAAC;AACrD,cAAc,4CAA4C,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 RewardInterstitialAdOptions 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-interstitial-ad-options.interface.js","sourceRoot":"","sources":["../../../src/reward-interstitial/reward-interstitial-ad-options.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare enum RewardInterstitialAdPluginEvents {
|
|
2
|
+
/**
|
|
3
|
+
* Emits after trying to prepare a RewardAd and the Video is loaded and ready to be show
|
|
4
|
+
*/
|
|
5
|
+
Loaded = "onRewardedInterstitialAdLoaded",
|
|
6
|
+
/**
|
|
7
|
+
* Emits after trying to prepare a RewardAd when it could not be loaded
|
|
8
|
+
*/
|
|
9
|
+
FailedToLoad = "onRewardedInterstitialAdFailedToLoad",
|
|
10
|
+
/**
|
|
11
|
+
* Emits when the AdReward video is visible to the user
|
|
12
|
+
*/
|
|
13
|
+
Showed = "onRewardedInterstitialAdShowed",
|
|
14
|
+
/**
|
|
15
|
+
* Emits when the AdReward video is failed to show
|
|
16
|
+
*/
|
|
17
|
+
FailedToShow = "onRewardedInterstitialAdFailedToShow",
|
|
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 = "onRewardedInterstitialAdDismissed",
|
|
28
|
+
/**
|
|
29
|
+
* Emits when user get rewarded from AdReward
|
|
30
|
+
*/
|
|
31
|
+
Rewarded = "onRewardedInterstitialAdReward"
|
|
32
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// This enum should be keep in sync with their native equivalents with the same name
|
|
2
|
+
export var RewardInterstitialAdPluginEvents;
|
|
3
|
+
(function (RewardInterstitialAdPluginEvents) {
|
|
4
|
+
/**
|
|
5
|
+
* Emits after trying to prepare a RewardAd and the Video is loaded and ready to be show
|
|
6
|
+
*/
|
|
7
|
+
RewardInterstitialAdPluginEvents["Loaded"] = "onRewardedInterstitialAdLoaded";
|
|
8
|
+
/**
|
|
9
|
+
* Emits after trying to prepare a RewardAd when it could not be loaded
|
|
10
|
+
*/
|
|
11
|
+
RewardInterstitialAdPluginEvents["FailedToLoad"] = "onRewardedInterstitialAdFailedToLoad";
|
|
12
|
+
/**
|
|
13
|
+
* Emits when the AdReward video is visible to the user
|
|
14
|
+
*/
|
|
15
|
+
RewardInterstitialAdPluginEvents["Showed"] = "onRewardedInterstitialAdShowed";
|
|
16
|
+
/**
|
|
17
|
+
* Emits when the AdReward video is failed to show
|
|
18
|
+
*/
|
|
19
|
+
RewardInterstitialAdPluginEvents["FailedToShow"] = "onRewardedInterstitialAdFailedToShow";
|
|
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
|
+
RewardInterstitialAdPluginEvents["Dismissed"] = "onRewardedInterstitialAdDismissed";
|
|
30
|
+
/**
|
|
31
|
+
* Emits when user get rewarded from AdReward
|
|
32
|
+
*/
|
|
33
|
+
RewardInterstitialAdPluginEvents["Rewarded"] = "onRewardedInterstitialAdReward";
|
|
34
|
+
})(RewardInterstitialAdPluginEvents || (RewardInterstitialAdPluginEvents = {}));
|
|
35
|
+
//# sourceMappingURL=reward-interstitial-ad-plugin-events.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reward-interstitial-ad-plugin-events.enum.js","sourceRoot":"","sources":["../../../src/reward-interstitial/reward-interstitial-ad-plugin-events.enum.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,MAAM,CAAN,IAAY,gCA+BX;AA/BD,WAAY,gCAAgC;IAC1C;;OAEG;IACH,6EAAyC,CAAA;IACzC;;OAEG;IACH,yFAAqD,CAAA;IACrD;;OAEG;IACH,6EAAyC,CAAA;IACzC;;OAEG;IACH,yFAAqD,CAAA;IACrD;;;;;;;;OAQG;IACH,mFAA+C,CAAA;IAC/C;;OAEG;IACH,+EAA2C,CAAA;AAC7C,CAAC,EA/BW,gCAAgC,KAAhC,gCAAgC,QA+B3C"}
|
|
@@ -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 { RewardInterstitialAdOptions } from './reward-interstitial-ad-options.interface';
|
|
5
|
+
import type { RewardInterstitialAdPluginEvents } from './reward-interstitial-ad-plugin-events.enum';
|
|
6
|
+
import type { AdMobRewardInterstitialItem } from './reward-interstitial-item.interface';
|
|
7
|
+
export declare type RewardInterstitialDefinitionsHasAllEvents = ValidateAllEventsEnumAreImplemented<RewardInterstitialAdPluginEvents, RewardInterstitialDefinitions>;
|
|
8
|
+
export interface RewardInterstitialDefinitions {
|
|
9
|
+
/**
|
|
10
|
+
* Prepare a reward video ad
|
|
11
|
+
*
|
|
12
|
+
* @group RewardVideo
|
|
13
|
+
* @param options RewardAdOptions
|
|
14
|
+
* @since 1.1.2
|
|
15
|
+
*/
|
|
16
|
+
prepareRewardInterstitialAd(options: RewardInterstitialAdOptions): Promise<AdLoadInfo>;
|
|
17
|
+
/**
|
|
18
|
+
* Show a reward video ad
|
|
19
|
+
*
|
|
20
|
+
* @group RewardVideo
|
|
21
|
+
* @since 1.1.2
|
|
22
|
+
*/
|
|
23
|
+
showRewardInterstitialAd(): Promise<AdMobRewardInterstitialItem>;
|
|
24
|
+
addListener(eventName: RewardInterstitialAdPluginEvents.FailedToLoad, listenerFunc: (error: AdMobError) => void): Promise<PluginListenerHandle>;
|
|
25
|
+
addListener(eventName: RewardInterstitialAdPluginEvents.Loaded, listenerFunc: (info: AdLoadInfo) => void): Promise<PluginListenerHandle>;
|
|
26
|
+
addListener(eventName: RewardInterstitialAdPluginEvents.Rewarded, listenerFunc: (reward: AdMobRewardInterstitialItem) => void): Promise<PluginListenerHandle>;
|
|
27
|
+
addListener(eventName: RewardInterstitialAdPluginEvents.Dismissed, listenerFunc: () => void): Promise<PluginListenerHandle>;
|
|
28
|
+
addListener(eventName: RewardInterstitialAdPluginEvents.FailedToShow, listenerFunc: (error: AdMobError) => void): Promise<PluginListenerHandle>;
|
|
29
|
+
addListener(eventName: RewardInterstitialAdPluginEvents.Showed, listenerFunc: () => void): Promise<PluginListenerHandle>;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reward-interstitial-definitions.interface.js","sourceRoot":"","sources":["../../../src/reward-interstitial/reward-interstitial-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 AdMobRewardInterstitialItem {
|
|
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-interstitial-item.interface.js","sourceRoot":"","sources":["../../../src/reward-interstitial/reward-interstitial-item.interface.ts"],"names":[],"mappings":""}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -4,9 +4,7 @@ import type { AdMobRewardItem } from './reward';
|
|
|
4
4
|
import type { AdOptions, AdLoadInfo } from './shared';
|
|
5
5
|
import type { TrackingAuthorizationStatusInterface } from './shared/tracking-authorization-status.interface';
|
|
6
6
|
export declare class AdMobWeb extends WebPlugin implements AdMobPlugin {
|
|
7
|
-
constructor();
|
|
8
7
|
initialize(): Promise<void>;
|
|
9
|
-
targetSettings(): Promise<void>;
|
|
10
8
|
requestTrackingAuthorization(): Promise<void>;
|
|
11
9
|
trackingAuthorizationStatus(): Promise<TrackingAuthorizationStatusInterface>;
|
|
12
10
|
requestConsentInfo(options?: AdmobConsentRequestOptions): Promise<AdmobConsentInfo>;
|
|
@@ -22,4 +20,6 @@ export declare class AdMobWeb extends WebPlugin implements AdMobPlugin {
|
|
|
22
20
|
showInterstitial(): Promise<void>;
|
|
23
21
|
prepareRewardVideoAd(options: AdOptions): Promise<AdLoadInfo>;
|
|
24
22
|
showRewardVideoAd(): Promise<AdMobRewardItem>;
|
|
23
|
+
prepareRewardInterstitialAd(options: AdOptions): Promise<AdLoadInfo>;
|
|
24
|
+
showRewardInterstitialAd(): Promise<AdMobRewardItem>;
|
|
25
25
|
}
|
package/dist/esm/web.js
CHANGED
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
import { WebPlugin } from '@capacitor/core';
|
|
2
2
|
import { AdmobConsentStatus } from './consent/consent-status.enum';
|
|
3
3
|
export class AdMobWeb extends WebPlugin {
|
|
4
|
-
constructor() {
|
|
5
|
-
super({
|
|
6
|
-
name: 'AdMob',
|
|
7
|
-
platforms: ['web'],
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
4
|
async initialize() {
|
|
11
5
|
console.log('initialize');
|
|
12
6
|
}
|
|
13
|
-
async targetSettings() {
|
|
14
|
-
console.log('targetSettings');
|
|
15
|
-
}
|
|
16
7
|
async requestTrackingAuthorization() {
|
|
17
8
|
console.log('requestTrackingAuthorization');
|
|
18
9
|
}
|
|
@@ -79,5 +70,17 @@ export class AdMobWeb extends WebPlugin {
|
|
|
79
70
|
amount: 0,
|
|
80
71
|
};
|
|
81
72
|
}
|
|
73
|
+
async prepareRewardInterstitialAd(options) {
|
|
74
|
+
console.log(options);
|
|
75
|
+
return {
|
|
76
|
+
adUnitId: options.adId,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
async showRewardInterstitialAd() {
|
|
80
|
+
return {
|
|
81
|
+
type: '',
|
|
82
|
+
amount: 0,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
82
85
|
}
|
|
83
86
|
//# 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;AAS5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAKnE,MAAM,OAAO,QAAS,SAAQ,SAAS;IACrC
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAS5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAKnE,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,EAAE,OAAO,CAAC,CAAC;QAC3C,OAAO;YACL,MAAM,EAAE,kBAAkB,CAAC,QAAQ;YACnC,sBAAsB,EAAE,IAAI;SAC7B,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,OAAO;YACL,MAAM,EAAE,kBAAkB,CAAC,QAAQ;SACpC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,OAAgC;QACxD,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,OAAiC;QAC1D,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,OAAkB;QACjC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,gEAAgE;IAChE,KAAK,CAAC,UAAU;QACd,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC5B,CAAC;IAED,wCAAwC;IACxC,KAAK,CAAC,YAAY;QAChB,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC9B,CAAC;IAED,6CAA6C;IAC7C,KAAK,CAAC,YAAY;QAChB,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,OAAkB;QAC1C,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;QAC5C,OAAO;YACL,QAAQ,EAAE,OAAO,CAAC,IAAI;SACvB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,OAAkB;QAC3C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACrB,OAAO;YACL,QAAQ,EAAE,OAAO,CAAC,IAAI;SACvB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,OAAO;YACL,IAAI,EAAE,EAAE;YACR,MAAM,EAAE,CAAC;SACV,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,2BAA2B,CAAC,OAAkB;QAClD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACrB,OAAO;YACL,QAAQ,EAAE,OAAO,CAAC,IAAI;SACvB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,wBAAwB;QAC5B,OAAO;YACL,IAAI,EAAE,EAAE;YACR,MAAM,EAAE,CAAC;SACV,CAAC;IACJ,CAAC;CACF"}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var core = require('@capacitor/core');
|
|
6
4
|
|
|
7
5
|
exports.MaxAdContentRating = void 0;
|
|
@@ -132,6 +130,41 @@ exports.InterstitialAdPluginEvents = void 0;
|
|
|
132
130
|
InterstitialAdPluginEvents["Dismissed"] = "interstitialAdDismissed";
|
|
133
131
|
})(exports.InterstitialAdPluginEvents || (exports.InterstitialAdPluginEvents = {}));
|
|
134
132
|
|
|
133
|
+
// This enum should be keep in sync with their native equivalents with the same name
|
|
134
|
+
exports.RewardInterstitialAdPluginEvents = void 0;
|
|
135
|
+
(function (RewardInterstitialAdPluginEvents) {
|
|
136
|
+
/**
|
|
137
|
+
* Emits after trying to prepare a RewardAd and the Video is loaded and ready to be show
|
|
138
|
+
*/
|
|
139
|
+
RewardInterstitialAdPluginEvents["Loaded"] = "onRewardedInterstitialAdLoaded";
|
|
140
|
+
/**
|
|
141
|
+
* Emits after trying to prepare a RewardAd when it could not be loaded
|
|
142
|
+
*/
|
|
143
|
+
RewardInterstitialAdPluginEvents["FailedToLoad"] = "onRewardedInterstitialAdFailedToLoad";
|
|
144
|
+
/**
|
|
145
|
+
* Emits when the AdReward video is visible to the user
|
|
146
|
+
*/
|
|
147
|
+
RewardInterstitialAdPluginEvents["Showed"] = "onRewardedInterstitialAdShowed";
|
|
148
|
+
/**
|
|
149
|
+
* Emits when the AdReward video is failed to show
|
|
150
|
+
*/
|
|
151
|
+
RewardInterstitialAdPluginEvents["FailedToShow"] = "onRewardedInterstitialAdFailedToShow";
|
|
152
|
+
/**
|
|
153
|
+
* Emits when the AdReward video is not visible to the user anymore.
|
|
154
|
+
*
|
|
155
|
+
* **Important**: This has nothing to do with the reward it self. This event
|
|
156
|
+
* will emits in this two cases:
|
|
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.
|
|
160
|
+
*/
|
|
161
|
+
RewardInterstitialAdPluginEvents["Dismissed"] = "onRewardedInterstitialAdDismissed";
|
|
162
|
+
/**
|
|
163
|
+
* Emits when user get rewarded from AdReward
|
|
164
|
+
*/
|
|
165
|
+
RewardInterstitialAdPluginEvents["Rewarded"] = "onRewardedInterstitialAdReward";
|
|
166
|
+
})(exports.RewardInterstitialAdPluginEvents || (exports.RewardInterstitialAdPluginEvents = {}));
|
|
167
|
+
|
|
135
168
|
// This enum should be keep in sync with their native equivalents with the same name
|
|
136
169
|
exports.RewardAdPluginEvents = void 0;
|
|
137
170
|
(function (RewardAdPluginEvents) {
|
|
@@ -214,22 +247,13 @@ exports.AdmobConsentDebugGeography = void 0;
|
|
|
214
247
|
})(exports.AdmobConsentDebugGeography || (exports.AdmobConsentDebugGeography = {}));
|
|
215
248
|
|
|
216
249
|
const AdMob = core.registerPlugin('AdMob', {
|
|
217
|
-
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.AdMobWeb()),
|
|
250
|
+
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.AdMobWeb()),
|
|
218
251
|
});
|
|
219
252
|
|
|
220
253
|
class AdMobWeb extends core.WebPlugin {
|
|
221
|
-
constructor() {
|
|
222
|
-
super({
|
|
223
|
-
name: 'AdMob',
|
|
224
|
-
platforms: ['web'],
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
254
|
async initialize() {
|
|
228
255
|
console.log('initialize');
|
|
229
256
|
}
|
|
230
|
-
async targetSettings() {
|
|
231
|
-
console.log('targetSettings');
|
|
232
|
-
}
|
|
233
257
|
async requestTrackingAuthorization() {
|
|
234
258
|
console.log('requestTrackingAuthorization');
|
|
235
259
|
}
|
|
@@ -296,6 +320,18 @@ class AdMobWeb extends core.WebPlugin {
|
|
|
296
320
|
amount: 0,
|
|
297
321
|
};
|
|
298
322
|
}
|
|
323
|
+
async prepareRewardInterstitialAd(options) {
|
|
324
|
+
console.log(options);
|
|
325
|
+
return {
|
|
326
|
+
adUnitId: options.adId,
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
async showRewardInterstitialAd() {
|
|
330
|
+
return {
|
|
331
|
+
type: '',
|
|
332
|
+
amount: 0,
|
|
333
|
+
};
|
|
334
|
+
}
|
|
299
335
|
}
|
|
300
336
|
|
|
301
337
|
var web = /*#__PURE__*/Object.freeze({
|