File tree Expand file tree Collapse file tree 3 files changed +29
-3
lines changed
Expand file tree Collapse file tree 3 files changed +29
-3
lines changed Original file line number Diff line number Diff line change 11export * from './reward-ad-plugin-events.enum' ;
22export * from './reward-definitions.interface' ;
33export * from './reward-item.interface' ;
4+ export * from './reward-ad-options.interface' ;
Original file line number Diff line number Diff line change 1+ import type { AdOptions } from '../shared/ad-options.interface' ;
2+
3+ // This is a type to ensure that IF ssv is provided, at least one of userId or customData is required.
4+ type AtLeastOne < T > = { [ K in keyof T ] : Pick < T , K > } [ keyof T ] ;
5+
6+ // Because only RewardedAds use SSV. This interface is only available for RewardedAds
7+ export interface RewardAdOptions extends AdOptions {
8+ /**
9+ * If you have enabled SSV in your AdMob Application. You can provide customData or
10+ * a userId be passed to your callback to do further processing on.
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+ }
Original file line number Diff line number Diff line change 11import type { PluginListenerHandle } from '@capacitor/core' ;
22
33import type { ValidateAllEventsEnumAreImplemented } from '../private/validate-all-events-implemented.type'
4- import type { AdLoadInfo , AdMobError , AdOptions } from '../shared' ;
4+ import type { AdLoadInfo , AdMobError } from '../shared' ;
55
6+ import type { RewardAdOptions } from './reward-ad-options.interface' ;
67import type { RewardAdPluginEvents } from './reward-ad-plugin-events.enum' ;
78import type { AdMobRewardItem } from './reward-item.interface' ;
89
@@ -14,10 +15,10 @@ export interface RewardDefinitions {
1415 * Prepare a reward video ad
1516 *
1617 * @group RewardVideo
17- * @param options AdOptions
18+ * @param options RewardAdOptions
1819 * @since 1.1.2
1920 */
20- prepareRewardVideoAd ( options : AdOptions ) : Promise < AdLoadInfo > ;
21+ prepareRewardVideoAd ( options : RewardAdOptions ) : Promise < AdLoadInfo > ;
2122
2223 /**
2324 * Show a reward video ad
You can’t perform that action at this time.
0 commit comments