@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
|
@@ -2,24 +2,28 @@
|
|
|
2
2
|
export var InterstitialAdPluginEvents;
|
|
3
3
|
(function (InterstitialAdPluginEvents) {
|
|
4
4
|
/**
|
|
5
|
-
* Emits
|
|
5
|
+
* Emits when an interstitial ad has loaded and is ready to show.
|
|
6
6
|
*/
|
|
7
7
|
InterstitialAdPluginEvents["Loaded"] = "interstitialAdLoaded";
|
|
8
8
|
/**
|
|
9
|
-
* Emits
|
|
9
|
+
* Emits when an interstitial ad fails to load.
|
|
10
10
|
*/
|
|
11
11
|
InterstitialAdPluginEvents["FailedToLoad"] = "interstitialAdFailedToLoad";
|
|
12
12
|
/**
|
|
13
|
-
* Emits when
|
|
13
|
+
* Emits when an interstitial ad is shown.
|
|
14
14
|
*/
|
|
15
15
|
InterstitialAdPluginEvents["Showed"] = "interstitialAdShowed";
|
|
16
16
|
/**
|
|
17
|
-
* Emits when
|
|
17
|
+
* Emits when a loaded interstitial ad fails to show.
|
|
18
18
|
*/
|
|
19
19
|
InterstitialAdPluginEvents["FailedToShow"] = "interstitialAdFailedToShow";
|
|
20
20
|
/**
|
|
21
|
-
* Emits when
|
|
21
|
+
* Emits when an interstitial ad is dismissed.
|
|
22
22
|
*/
|
|
23
23
|
InterstitialAdPluginEvents["Dismissed"] = "interstitialAdDismissed";
|
|
24
|
+
/**
|
|
25
|
+
* Emits impression-level ad revenue data when a paid event is recorded.
|
|
26
|
+
*/
|
|
27
|
+
InterstitialAdPluginEvents["AdImpression"] = "interstitialAdImpression";
|
|
24
28
|
})(InterstitialAdPluginEvents || (InterstitialAdPluginEvents = {}));
|
|
25
29
|
//# sourceMappingURL=interstitial-ad-plugin-events.enum.js.map
|
|
@@ -1 +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,
|
|
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,0BAyBX;AAzBD,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;IACpC;;OAEG;IACH,uEAAyC,CAAA;AAC3C,CAAC,EAzBW,0BAA0B,KAA1B,0BAA0B,QAyBrC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { PluginListenerHandle } from '@capacitor/core';
|
|
2
2
|
import type { ValidateAllEventsEnumAreImplemented } from '../private/validate-all-events-implemented.type';
|
|
3
|
-
import type { AdLoadInfo, AdMobError, AdOptions } from '../shared';
|
|
3
|
+
import type { AdLoadInfo, AdMobError, AdMobRevenueData, AdOptions, AdShowOptions } from '../shared';
|
|
4
4
|
import type { InterstitialAdPluginEvents } from './interstitial-ad-plugin-events.enum';
|
|
5
5
|
export type InterstitialDefinitionsHasAllEvents = ValidateAllEventsEnumAreImplemented<InterstitialAdPluginEvents, InterstitialDefinitions>;
|
|
6
6
|
export interface InterstitialDefinitions {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Loads an interstitial ad and returns the loaded ad unit ID.
|
|
9
9
|
*
|
|
10
10
|
* @group Interstitial
|
|
11
11
|
* @param options AdOptions
|
|
@@ -13,15 +13,35 @@ export interface InterstitialDefinitions {
|
|
|
13
13
|
*/
|
|
14
14
|
prepareInterstitial(options: AdOptions): Promise<AdLoadInfo>;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Shows a loaded interstitial ad.
|
|
17
17
|
*
|
|
18
18
|
* @group Interstitial
|
|
19
|
+
* @param options Optional. Pass { adId } to show a specific prepared ad instead of the most recent one.
|
|
19
20
|
* @since 1.1.2
|
|
20
21
|
*/
|
|
21
|
-
showInterstitial(): Promise<void>;
|
|
22
|
+
showInterstitial(options?: AdShowOptions): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Listens for interstitial ad load failures.
|
|
25
|
+
*/
|
|
22
26
|
addListener(eventName: InterstitialAdPluginEvents.FailedToLoad, listenerFunc: (error: AdMobError) => void): Promise<PluginListenerHandle>;
|
|
27
|
+
/**
|
|
28
|
+
* Listens for interstitial ad load events.
|
|
29
|
+
*/
|
|
23
30
|
addListener(eventName: InterstitialAdPluginEvents.Loaded, listenerFunc: (info: AdLoadInfo) => void): Promise<PluginListenerHandle>;
|
|
31
|
+
/**
|
|
32
|
+
* Listens for interstitial ad dismissed events.
|
|
33
|
+
*/
|
|
24
34
|
addListener(eventName: InterstitialAdPluginEvents.Dismissed, listenerFunc: () => void): Promise<PluginListenerHandle>;
|
|
35
|
+
/**
|
|
36
|
+
* Listens for interstitial ad show failures.
|
|
37
|
+
*/
|
|
25
38
|
addListener(eventName: InterstitialAdPluginEvents.FailedToShow, listenerFunc: (error: AdMobError) => void): Promise<PluginListenerHandle>;
|
|
39
|
+
/**
|
|
40
|
+
* Listens for interstitial ad shown events.
|
|
41
|
+
*/
|
|
26
42
|
addListener(eventName: InterstitialAdPluginEvents.Showed, listenerFunc: () => void): Promise<PluginListenerHandle>;
|
|
43
|
+
/**
|
|
44
|
+
* Listens for interstitial impression-level ad revenue events.
|
|
45
|
+
*/
|
|
46
|
+
addListener(eventName: InterstitialAdPluginEvents.AdImpression, listenerFunc: (data: AdMobRevenueData) => void): Promise<PluginListenerHandle>;
|
|
27
47
|
}
|
|
@@ -2,22 +2,23 @@ import type { AdOptions } from '../shared/ad-options.interface';
|
|
|
2
2
|
type AtLeastOne<T> = {
|
|
3
3
|
[K in keyof T]: Pick<T, K>;
|
|
4
4
|
}[keyof T];
|
|
5
|
+
/**
|
|
6
|
+
* Options for loading a rewarded ad.
|
|
7
|
+
*/
|
|
5
8
|
export interface RewardAdOptions extends AdOptions {
|
|
6
9
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* *Important* You *HAVE* to define one of them.
|
|
10
|
+
* Server-side verification options for the rewarded ad.
|
|
11
|
+
* Provide at least one of `userId` or `customData`.
|
|
11
12
|
*
|
|
12
13
|
* @see https://support.google.com/admob/answer/9603226?hl=en-GB
|
|
13
14
|
*/
|
|
14
15
|
ssv?: AtLeastOne<{
|
|
15
16
|
/**
|
|
16
|
-
*
|
|
17
|
+
* A user identifier passed to the SSV callback.
|
|
17
18
|
*/
|
|
18
19
|
userId: string;
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
+
* Custom data passed to the SSV callback.
|
|
21
22
|
*/
|
|
22
23
|
customData: string;
|
|
23
24
|
}>;
|
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
export declare enum RewardAdPluginEvents {
|
|
2
2
|
/**
|
|
3
|
-
* Emits
|
|
3
|
+
* Emits when a rewarded ad has loaded and is ready to show.
|
|
4
4
|
*/
|
|
5
5
|
Loaded = "onRewardedVideoAdLoaded",
|
|
6
6
|
/**
|
|
7
|
-
* Emits
|
|
7
|
+
* Emits when a rewarded ad fails to load.
|
|
8
8
|
*/
|
|
9
9
|
FailedToLoad = "onRewardedVideoAdFailedToLoad",
|
|
10
10
|
/**
|
|
11
|
-
* Emits when
|
|
11
|
+
* Emits when a rewarded ad is shown.
|
|
12
12
|
*/
|
|
13
13
|
Showed = "onRewardedVideoAdShowed",
|
|
14
14
|
/**
|
|
15
|
-
* Emits when
|
|
15
|
+
* Emits when a loaded rewarded ad fails to show.
|
|
16
16
|
*/
|
|
17
17
|
FailedToShow = "onRewardedVideoAdFailedToShow",
|
|
18
18
|
/**
|
|
19
|
-
* Emits when
|
|
19
|
+
* Emits when a rewarded ad is dismissed.
|
|
20
20
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
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.
|
|
21
|
+
* This event does not indicate whether the user earned a reward. Listen for
|
|
22
|
+
* `Rewarded` separately before granting the reward.
|
|
26
23
|
*/
|
|
27
24
|
Dismissed = "onRewardedVideoAdDismissed",
|
|
28
25
|
/**
|
|
29
|
-
* Emits when user
|
|
26
|
+
* Emits when the user earns the advertised reward.
|
|
30
27
|
*/
|
|
31
|
-
Rewarded = "onRewardedVideoAdReward"
|
|
28
|
+
Rewarded = "onRewardedVideoAdReward",
|
|
29
|
+
/**
|
|
30
|
+
* Emits impression-level ad revenue data when a paid event is recorded.
|
|
31
|
+
*/
|
|
32
|
+
AdImpression = "onRewardedVideoAdImpression"
|
|
32
33
|
}
|
|
@@ -2,34 +2,35 @@
|
|
|
2
2
|
export var RewardAdPluginEvents;
|
|
3
3
|
(function (RewardAdPluginEvents) {
|
|
4
4
|
/**
|
|
5
|
-
* Emits
|
|
5
|
+
* Emits when a rewarded ad has loaded and is ready to show.
|
|
6
6
|
*/
|
|
7
7
|
RewardAdPluginEvents["Loaded"] = "onRewardedVideoAdLoaded";
|
|
8
8
|
/**
|
|
9
|
-
* Emits
|
|
9
|
+
* Emits when a rewarded ad fails to load.
|
|
10
10
|
*/
|
|
11
11
|
RewardAdPluginEvents["FailedToLoad"] = "onRewardedVideoAdFailedToLoad";
|
|
12
12
|
/**
|
|
13
|
-
* Emits when
|
|
13
|
+
* Emits when a rewarded ad is shown.
|
|
14
14
|
*/
|
|
15
15
|
RewardAdPluginEvents["Showed"] = "onRewardedVideoAdShowed";
|
|
16
16
|
/**
|
|
17
|
-
* Emits when
|
|
17
|
+
* Emits when a loaded rewarded ad fails to show.
|
|
18
18
|
*/
|
|
19
19
|
RewardAdPluginEvents["FailedToShow"] = "onRewardedVideoAdFailedToShow";
|
|
20
20
|
/**
|
|
21
|
-
* Emits when
|
|
21
|
+
* Emits when a rewarded ad is dismissed.
|
|
22
22
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
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.
|
|
23
|
+
* This event does not indicate whether the user earned a reward. Listen for
|
|
24
|
+
* `Rewarded` separately before granting the reward.
|
|
28
25
|
*/
|
|
29
26
|
RewardAdPluginEvents["Dismissed"] = "onRewardedVideoAdDismissed";
|
|
30
27
|
/**
|
|
31
|
-
* Emits when user
|
|
28
|
+
* Emits when the user earns the advertised reward.
|
|
32
29
|
*/
|
|
33
30
|
RewardAdPluginEvents["Rewarded"] = "onRewardedVideoAdReward";
|
|
31
|
+
/**
|
|
32
|
+
* Emits impression-level ad revenue data when a paid event is recorded.
|
|
33
|
+
*/
|
|
34
|
+
RewardAdPluginEvents["AdImpression"] = "onRewardedVideoAdImpression";
|
|
34
35
|
})(RewardAdPluginEvents || (RewardAdPluginEvents = {}));
|
|
35
36
|
//# sourceMappingURL=reward-ad-plugin-events.enum.js.map
|
|
@@ -1 +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,
|
|
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,oBAgCX;AAhCD,WAAY,oBAAoB;IAC9B;;OAEG;IACH,0DAAkC,CAAA;IAClC;;OAEG;IACH,sEAA8C,CAAA;IAC9C;;OAEG;IACH,0DAAkC,CAAA;IAClC;;OAEG;IACH,sEAA8C,CAAA;IAC9C;;;;;OAKG;IACH,gEAAuC,CAAA;IACvC;;OAEG;IACH,4DAAmC,CAAA;IACnC;;OAEG;IACH,oEAA4C,CAAA;AAC9C,CAAC,EAhCW,oBAAoB,KAApB,oBAAoB,QAgC/B"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { PluginListenerHandle } from '@capacitor/core';
|
|
2
2
|
import type { ValidateAllEventsEnumAreImplemented } from '../private/validate-all-events-implemented.type';
|
|
3
|
-
import type { AdLoadInfo, AdMobError } from '../shared';
|
|
3
|
+
import type { AdLoadInfo, AdMobError, AdMobRevenueData, AdShowOptions } from '../shared';
|
|
4
4
|
import type { RewardAdOptions } from './reward-ad-options.interface';
|
|
5
5
|
import type { RewardAdPluginEvents } from './reward-ad-plugin-events.enum';
|
|
6
6
|
import type { AdMobRewardItem } from './reward-item.interface';
|
|
7
7
|
export type RewardDefinitionsHasAllEvents = ValidateAllEventsEnumAreImplemented<RewardAdPluginEvents, RewardDefinitions>;
|
|
8
8
|
export interface RewardDefinitions {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Loads a rewarded ad and returns the loaded ad unit ID.
|
|
11
11
|
*
|
|
12
12
|
* @group RewardVideo
|
|
13
13
|
* @param options RewardAdOptions
|
|
@@ -15,16 +15,39 @@ export interface RewardDefinitions {
|
|
|
15
15
|
*/
|
|
16
16
|
prepareRewardVideoAd(options: RewardAdOptions): Promise<AdLoadInfo>;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Shows a loaded rewarded ad and resolves when the user earns the reward.
|
|
19
19
|
*
|
|
20
20
|
* @group RewardVideo
|
|
21
|
+
* @param options Optional. Pass { adId } to show a specific prepared ad instead of the most recent one.
|
|
21
22
|
* @since 1.1.2
|
|
22
23
|
*/
|
|
23
|
-
showRewardVideoAd(): Promise<AdMobRewardItem>;
|
|
24
|
+
showRewardVideoAd(options?: AdShowOptions): Promise<AdMobRewardItem>;
|
|
25
|
+
/**
|
|
26
|
+
* Listens for rewarded ad load failures.
|
|
27
|
+
*/
|
|
24
28
|
addListener(eventName: RewardAdPluginEvents.FailedToLoad, listenerFunc: (error: AdMobError) => void): Promise<PluginListenerHandle>;
|
|
29
|
+
/**
|
|
30
|
+
* Listens for rewarded ad load events.
|
|
31
|
+
*/
|
|
25
32
|
addListener(eventName: RewardAdPluginEvents.Loaded, listenerFunc: (info: AdLoadInfo) => void): Promise<PluginListenerHandle>;
|
|
33
|
+
/**
|
|
34
|
+
* Listens for earned reward events.
|
|
35
|
+
*/
|
|
26
36
|
addListener(eventName: RewardAdPluginEvents.Rewarded, listenerFunc: (reward: AdMobRewardItem) => void): Promise<PluginListenerHandle>;
|
|
37
|
+
/**
|
|
38
|
+
* Listens for rewarded ad dismissed events.
|
|
39
|
+
*/
|
|
27
40
|
addListener(eventName: RewardAdPluginEvents.Dismissed, listenerFunc: () => void): Promise<PluginListenerHandle>;
|
|
41
|
+
/**
|
|
42
|
+
* Listens for rewarded ad show failures.
|
|
43
|
+
*/
|
|
28
44
|
addListener(eventName: RewardAdPluginEvents.FailedToShow, listenerFunc: (error: AdMobError) => void): Promise<PluginListenerHandle>;
|
|
45
|
+
/**
|
|
46
|
+
* Listens for rewarded ad shown events.
|
|
47
|
+
*/
|
|
29
48
|
addListener(eventName: RewardAdPluginEvents.Showed, listenerFunc: () => void): Promise<PluginListenerHandle>;
|
|
49
|
+
/**
|
|
50
|
+
* Listens for rewarded impression-level ad revenue events.
|
|
51
|
+
*/
|
|
52
|
+
addListener(eventName: RewardAdPluginEvents.AdImpression, listenerFunc: (data: AdMobRevenueData) => void): Promise<PluginListenerHandle>;
|
|
30
53
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* https://developers.google.com/admob/android/rewarded-video-adapters?hl=en
|
|
2
|
+
* The reward earned by the user after viewing a rewarded ad.
|
|
4
3
|
*/
|
|
5
4
|
export interface AdMobRewardItem {
|
|
6
5
|
/**
|
|
7
|
-
*
|
|
6
|
+
* The reward item type configured for the ad unit.
|
|
8
7
|
*/
|
|
9
8
|
type: string;
|
|
10
9
|
/**
|
|
11
|
-
*
|
|
10
|
+
* The reward amount earned by the user.
|
|
12
11
|
*/
|
|
13
12
|
amount: number;
|
|
14
13
|
}
|
|
@@ -2,22 +2,23 @@ import type { AdOptions } from '../shared/ad-options.interface';
|
|
|
2
2
|
type AtLeastOne<T> = {
|
|
3
3
|
[K in keyof T]: Pick<T, K>;
|
|
4
4
|
}[keyof T];
|
|
5
|
+
/**
|
|
6
|
+
* Options for loading a rewarded interstitial ad.
|
|
7
|
+
*/
|
|
5
8
|
export interface RewardInterstitialAdOptions extends AdOptions {
|
|
6
9
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* *Important* You *HAVE* to define one of them.
|
|
10
|
+
* Server-side verification options for the rewarded interstitial ad.
|
|
11
|
+
* Provide at least one of `userId` or `customData`.
|
|
11
12
|
*
|
|
12
13
|
* @see https://support.google.com/admob/answer/9603226?hl=en-GB
|
|
13
14
|
*/
|
|
14
15
|
ssv?: AtLeastOne<{
|
|
15
16
|
/**
|
|
16
|
-
*
|
|
17
|
+
* A user identifier passed to the SSV callback.
|
|
17
18
|
*/
|
|
18
19
|
userId: string;
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
+
* Custom data passed to the SSV callback.
|
|
21
22
|
*/
|
|
22
23
|
customData: string;
|
|
23
24
|
}>;
|
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
export declare enum RewardInterstitialAdPluginEvents {
|
|
2
2
|
/**
|
|
3
|
-
* Emits
|
|
3
|
+
* Emits when a rewarded interstitial ad has loaded and is ready to show.
|
|
4
4
|
*/
|
|
5
5
|
Loaded = "onRewardedInterstitialAdLoaded",
|
|
6
6
|
/**
|
|
7
|
-
* Emits
|
|
7
|
+
* Emits when a rewarded interstitial ad fails to load.
|
|
8
8
|
*/
|
|
9
9
|
FailedToLoad = "onRewardedInterstitialAdFailedToLoad",
|
|
10
10
|
/**
|
|
11
|
-
* Emits when
|
|
11
|
+
* Emits when a rewarded interstitial ad is shown.
|
|
12
12
|
*/
|
|
13
13
|
Showed = "onRewardedInterstitialAdShowed",
|
|
14
14
|
/**
|
|
15
|
-
* Emits when
|
|
15
|
+
* Emits when a loaded rewarded interstitial ad fails to show.
|
|
16
16
|
*/
|
|
17
17
|
FailedToShow = "onRewardedInterstitialAdFailedToShow",
|
|
18
18
|
/**
|
|
19
|
-
* Emits when
|
|
19
|
+
* Emits when a rewarded interstitial ad is dismissed.
|
|
20
20
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
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.
|
|
21
|
+
* This event does not indicate whether the user earned a reward. Listen for
|
|
22
|
+
* `Rewarded` separately before granting the reward.
|
|
26
23
|
*/
|
|
27
24
|
Dismissed = "onRewardedInterstitialAdDismissed",
|
|
28
25
|
/**
|
|
29
|
-
* Emits when user
|
|
26
|
+
* Emits when the user earns the advertised reward.
|
|
30
27
|
*/
|
|
31
|
-
Rewarded = "onRewardedInterstitialAdReward"
|
|
28
|
+
Rewarded = "onRewardedInterstitialAdReward",
|
|
29
|
+
/**
|
|
30
|
+
* Emits impression-level ad revenue data when a paid event is recorded.
|
|
31
|
+
*/
|
|
32
|
+
AdImpression = "onRewardedInterstitialAdImpression"
|
|
32
33
|
}
|
|
@@ -2,34 +2,35 @@
|
|
|
2
2
|
export var RewardInterstitialAdPluginEvents;
|
|
3
3
|
(function (RewardInterstitialAdPluginEvents) {
|
|
4
4
|
/**
|
|
5
|
-
* Emits
|
|
5
|
+
* Emits when a rewarded interstitial ad has loaded and is ready to show.
|
|
6
6
|
*/
|
|
7
7
|
RewardInterstitialAdPluginEvents["Loaded"] = "onRewardedInterstitialAdLoaded";
|
|
8
8
|
/**
|
|
9
|
-
* Emits
|
|
9
|
+
* Emits when a rewarded interstitial ad fails to load.
|
|
10
10
|
*/
|
|
11
11
|
RewardInterstitialAdPluginEvents["FailedToLoad"] = "onRewardedInterstitialAdFailedToLoad";
|
|
12
12
|
/**
|
|
13
|
-
* Emits when
|
|
13
|
+
* Emits when a rewarded interstitial ad is shown.
|
|
14
14
|
*/
|
|
15
15
|
RewardInterstitialAdPluginEvents["Showed"] = "onRewardedInterstitialAdShowed";
|
|
16
16
|
/**
|
|
17
|
-
* Emits when
|
|
17
|
+
* Emits when a loaded rewarded interstitial ad fails to show.
|
|
18
18
|
*/
|
|
19
19
|
RewardInterstitialAdPluginEvents["FailedToShow"] = "onRewardedInterstitialAdFailedToShow";
|
|
20
20
|
/**
|
|
21
|
-
* Emits when
|
|
21
|
+
* Emits when a rewarded interstitial ad is dismissed.
|
|
22
22
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
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.
|
|
23
|
+
* This event does not indicate whether the user earned a reward. Listen for
|
|
24
|
+
* `Rewarded` separately before granting the reward.
|
|
28
25
|
*/
|
|
29
26
|
RewardInterstitialAdPluginEvents["Dismissed"] = "onRewardedInterstitialAdDismissed";
|
|
30
27
|
/**
|
|
31
|
-
* Emits when user
|
|
28
|
+
* Emits when the user earns the advertised reward.
|
|
32
29
|
*/
|
|
33
30
|
RewardInterstitialAdPluginEvents["Rewarded"] = "onRewardedInterstitialAdReward";
|
|
31
|
+
/**
|
|
32
|
+
* Emits impression-level ad revenue data when a paid event is recorded.
|
|
33
|
+
*/
|
|
34
|
+
RewardInterstitialAdPluginEvents["AdImpression"] = "onRewardedInterstitialAdImpression";
|
|
34
35
|
})(RewardInterstitialAdPluginEvents || (RewardInterstitialAdPluginEvents = {}));
|
|
35
36
|
//# sourceMappingURL=reward-interstitial-ad-plugin-events.enum.js.map
|
|
@@ -1 +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,
|
|
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,gCAgCX;AAhCD,WAAY,gCAAgC;IAC1C;;OAEG;IACH,6EAAyC,CAAA;IACzC;;OAEG;IACH,yFAAqD,CAAA;IACrD;;OAEG;IACH,6EAAyC,CAAA;IACzC;;OAEG;IACH,yFAAqD,CAAA;IACrD;;;;;OAKG;IACH,mFAA+C,CAAA;IAC/C;;OAEG;IACH,+EAA2C,CAAA;IAC3C;;OAEG;IACH,uFAAmD,CAAA;AACrD,CAAC,EAhCW,gCAAgC,KAAhC,gCAAgC,QAgC3C"}
|
|
@@ -1,30 +1,53 @@
|
|
|
1
1
|
import type { PluginListenerHandle } from '@capacitor/core';
|
|
2
2
|
import type { ValidateAllEventsEnumAreImplemented } from '../private/validate-all-events-implemented.type';
|
|
3
|
-
import type { AdLoadInfo, AdMobError } from '../shared';
|
|
3
|
+
import type { AdLoadInfo, AdMobError, AdMobRevenueData, AdShowOptions } from '../shared';
|
|
4
4
|
import type { RewardInterstitialAdOptions } from './reward-interstitial-ad-options.interface';
|
|
5
5
|
import type { RewardInterstitialAdPluginEvents } from './reward-interstitial-ad-plugin-events.enum';
|
|
6
6
|
import type { AdMobRewardInterstitialItem } from './reward-interstitial-item.interface';
|
|
7
7
|
export type RewardInterstitialDefinitionsHasAllEvents = ValidateAllEventsEnumAreImplemented<RewardInterstitialAdPluginEvents, RewardInterstitialDefinitions>;
|
|
8
8
|
export interface RewardInterstitialDefinitions {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Loads a rewarded interstitial ad and returns the loaded ad unit ID.
|
|
11
11
|
*
|
|
12
|
-
* @group
|
|
13
|
-
* @param options
|
|
12
|
+
* @group RewardInterstitial
|
|
13
|
+
* @param options RewardInterstitialAdOptions
|
|
14
14
|
* @since 1.1.2
|
|
15
15
|
*/
|
|
16
16
|
prepareRewardInterstitialAd(options: RewardInterstitialAdOptions): Promise<AdLoadInfo>;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Shows a loaded rewarded interstitial ad and resolves when the user earns the reward.
|
|
19
19
|
*
|
|
20
|
-
* @group
|
|
20
|
+
* @group RewardInterstitial
|
|
21
|
+
* @param options Optional. Pass { adId } to show a specific prepared ad instead of the most recent one.
|
|
21
22
|
* @since 1.1.2
|
|
22
23
|
*/
|
|
23
|
-
showRewardInterstitialAd(): Promise<AdMobRewardInterstitialItem>;
|
|
24
|
+
showRewardInterstitialAd(options?: AdShowOptions): Promise<AdMobRewardInterstitialItem>;
|
|
25
|
+
/**
|
|
26
|
+
* Listens for rewarded interstitial ad load failures.
|
|
27
|
+
*/
|
|
24
28
|
addListener(eventName: RewardInterstitialAdPluginEvents.FailedToLoad, listenerFunc: (error: AdMobError) => void): Promise<PluginListenerHandle>;
|
|
29
|
+
/**
|
|
30
|
+
* Listens for rewarded interstitial ad load events.
|
|
31
|
+
*/
|
|
25
32
|
addListener(eventName: RewardInterstitialAdPluginEvents.Loaded, listenerFunc: (info: AdLoadInfo) => void): Promise<PluginListenerHandle>;
|
|
33
|
+
/**
|
|
34
|
+
* Listens for earned reward events.
|
|
35
|
+
*/
|
|
26
36
|
addListener(eventName: RewardInterstitialAdPluginEvents.Rewarded, listenerFunc: (reward: AdMobRewardInterstitialItem) => void): Promise<PluginListenerHandle>;
|
|
37
|
+
/**
|
|
38
|
+
* Listens for rewarded interstitial ad dismissed events.
|
|
39
|
+
*/
|
|
27
40
|
addListener(eventName: RewardInterstitialAdPluginEvents.Dismissed, listenerFunc: () => void): Promise<PluginListenerHandle>;
|
|
41
|
+
/**
|
|
42
|
+
* Listens for rewarded interstitial ad show failures.
|
|
43
|
+
*/
|
|
28
44
|
addListener(eventName: RewardInterstitialAdPluginEvents.FailedToShow, listenerFunc: (error: AdMobError) => void): Promise<PluginListenerHandle>;
|
|
45
|
+
/**
|
|
46
|
+
* Listens for rewarded interstitial ad shown events.
|
|
47
|
+
*/
|
|
29
48
|
addListener(eventName: RewardInterstitialAdPluginEvents.Showed, listenerFunc: () => void): Promise<PluginListenerHandle>;
|
|
49
|
+
/**
|
|
50
|
+
* Listens for rewarded interstitial impression-level ad revenue events.
|
|
51
|
+
*/
|
|
52
|
+
addListener(eventName: RewardInterstitialAdPluginEvents.AdImpression, listenerFunc: (data: AdMobRevenueData) => void): Promise<PluginListenerHandle>;
|
|
30
53
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* https://developers.google.com/admob/android/rewarded-video-adapters?hl=en
|
|
2
|
+
* The reward earned by the user after viewing a rewarded interstitial ad.
|
|
4
3
|
*/
|
|
5
4
|
export interface AdMobRewardInterstitialItem {
|
|
6
5
|
/**
|
|
7
|
-
*
|
|
6
|
+
* The reward item type configured for the ad unit.
|
|
8
7
|
*/
|
|
9
8
|
type: string;
|
|
10
9
|
/**
|
|
11
|
-
*
|
|
10
|
+
* The reward amount earned by the user.
|
|
12
11
|
*/
|
|
13
12
|
amount: number;
|
|
14
13
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The precision of an impression-level ad value.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum AdValuePrecision {
|
|
5
|
+
/**
|
|
6
|
+
* The ad value precision is unknown.
|
|
7
|
+
*/
|
|
8
|
+
Unknown = 0,
|
|
9
|
+
/**
|
|
10
|
+
* The ad value is estimated from aggregated data.
|
|
11
|
+
*/
|
|
12
|
+
Estimated = 1,
|
|
13
|
+
/**
|
|
14
|
+
* The ad value was provided by the publisher.
|
|
15
|
+
*/
|
|
16
|
+
PublisherProvided = 2,
|
|
17
|
+
/**
|
|
18
|
+
* The ad value is the precise value paid for this ad.
|
|
19
|
+
*/
|
|
20
|
+
Precise = 3
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Impression-level ad revenue data emitted by a paid event.
|
|
24
|
+
*/
|
|
25
|
+
export interface AdMobRevenueData {
|
|
26
|
+
/**
|
|
27
|
+
* The ad unit ID associated with the paid event.
|
|
28
|
+
*/
|
|
29
|
+
adUnitId: string;
|
|
30
|
+
/**
|
|
31
|
+
* The ad value in micros, where 1,000,000 micros equals one currency unit.
|
|
32
|
+
*/
|
|
33
|
+
valueMicros: number;
|
|
34
|
+
/**
|
|
35
|
+
* The ISO 4217 currency code for `valueMicros`.
|
|
36
|
+
*/
|
|
37
|
+
currencyCode: string;
|
|
38
|
+
/**
|
|
39
|
+
* The precision of the reported ad value.
|
|
40
|
+
*/
|
|
41
|
+
precision: AdValuePrecision;
|
|
42
|
+
/**
|
|
43
|
+
* The mediation adapter class name that served the impression, or an empty string when unavailable.
|
|
44
|
+
*/
|
|
45
|
+
networkName: string;
|
|
46
|
+
/**
|
|
47
|
+
* The response identifier associated with the impression, or an empty string when unavailable.
|
|
48
|
+
*/
|
|
49
|
+
impressionId: string;
|
|
50
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The precision of an impression-level ad value.
|
|
3
|
+
*/
|
|
4
|
+
export var AdValuePrecision;
|
|
5
|
+
(function (AdValuePrecision) {
|
|
6
|
+
/**
|
|
7
|
+
* The ad value precision is unknown.
|
|
8
|
+
*/
|
|
9
|
+
AdValuePrecision[AdValuePrecision["Unknown"] = 0] = "Unknown";
|
|
10
|
+
/**
|
|
11
|
+
* The ad value is estimated from aggregated data.
|
|
12
|
+
*/
|
|
13
|
+
AdValuePrecision[AdValuePrecision["Estimated"] = 1] = "Estimated";
|
|
14
|
+
/**
|
|
15
|
+
* The ad value was provided by the publisher.
|
|
16
|
+
*/
|
|
17
|
+
AdValuePrecision[AdValuePrecision["PublisherProvided"] = 2] = "PublisherProvided";
|
|
18
|
+
/**
|
|
19
|
+
* The ad value is the precise value paid for this ad.
|
|
20
|
+
*/
|
|
21
|
+
AdValuePrecision[AdValuePrecision["Precise"] = 3] = "Precise";
|
|
22
|
+
})(AdValuePrecision || (AdValuePrecision = {}));
|
|
23
|
+
//# sourceMappingURL=ad-mob-revenue-data.interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ad-mob-revenue-data.interface.js","sourceRoot":"","sources":["../../../src/shared/ad-mob-revenue-data.interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,gBAoBX;AApBD,WAAY,gBAAgB;IAC1B;;OAEG;IACH,6DAAW,CAAA;IAEX;;OAEG;IACH,iEAAa,CAAA;IAEb;;OAEG;IACH,iFAAqB,CAAA;IAErB;;OAEG;IACH,6DAAW,CAAA;AACb,CAAC,EApBW,gBAAgB,KAAhB,gBAAgB,QAoB3B"}
|