@jolibox/ads 1.4.18-beta.1 → 1.4.19

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.
@@ -69,6 +69,8 @@ export interface IPlacementInfo {
69
69
  * | 'viewed' | The ad was viewed by the user |
70
70
  */
71
71
  breakStatus: 'notReady' | 'timeout' | 'error' | 'noAdPreloaded' | 'frequencyCapped' | 'ignored' | 'other' | 'dismissed' | 'viewed';
72
+ breakReason?: 'too_frequently_500ms' | 'ad_already_showing' | 'native_interstitial_not_ready' | 'native_reward_not_ready' | 'gpt_interstitial_not_ready' | 'gpt_reward_empty_render' | 'provider_frequency_cap' | 'unknown_frequency_cap' | 'called_too_soon_after_init' | 'network_not_ready' | 'ads_info_request_failed' | 'ads_info_invalid_code' | 'ads_info_empty' | 'provider_missing' | 'native_manager_missing' | 'native_preroll_not_supported' | 'native_show_failed' | 'native_unavailable' | 'unknown_no_ad_preloaded' | 'reward_not_completed' | 'interstitial_dismissed' | 'provider_dismissed' | 'unknown_dismissed';
73
+ breakStage?: 'before_ads_info' | 'ads_info' | 'before_provider' | 'provider_request' | 'native_show' | 'ad_terminal' | 'unknown';
72
74
  }
73
75
  /**
74
76
  * Parameter when calling adBreak
@@ -39,6 +39,7 @@ export declare class AdsRequest {
39
39
  private context;
40
40
  private contextInfo;
41
41
  private requestContext;
42
+ private adsInfoRequestSeq;
42
43
  private pendingAFGAdsInfo;
43
44
  private pendingAFVAdsInfo;
44
45
  constructor(context: IAdsContext, cacheInitial?: {
@@ -1,8 +1,8 @@
1
- import type { BreakStatus } from './type';
1
+ import type { BreakStatus, BreakStatusDetail } from './type';
2
2
  export interface IInterstitialAdContext {
3
3
  beforeAd?: () => void;
4
4
  afterAd?: () => void;
5
- onEnd?: (endReason: BreakStatus) => void;
5
+ onEnd?: (endReason: BreakStatus, detail?: BreakStatusDetail) => void;
6
6
  }
7
7
  /**
8
8
  * InterstitialAdManager class for managing Google GPT interstitial ads.
@@ -27,7 +27,7 @@ export declare class InterstitialAdManager {
27
27
  * The init function will potentially request an ad in the background.
28
28
  */
29
29
  private init;
30
- destroy: (endReason: BreakStatus, clearContext?: boolean) => void;
30
+ destroy: (endReason: BreakStatus, clearContext?: boolean, detail?: BreakStatusDetail) => void;
31
31
  /**
32
32
  * Destroy the interstitial ad and cleans up resources.
33
33
  *
@@ -36,7 +36,7 @@ export declare class InterstitialAdManager {
36
36
  *
37
37
  * @param endReason The reason for ending the ad.
38
38
  */
39
- reinit: (endReason: BreakStatus, clearContext?: boolean) => void;
39
+ reinit: (endReason: BreakStatus, clearContext?: boolean, detail?: BreakStatusDetail) => void;
40
40
  private handleSlotReady;
41
41
  private handleSlotClosed;
42
42
  /**
@@ -1,11 +1,11 @@
1
- import type { BreakStatus } from './type';
1
+ import type { BreakStatus, BreakStatusDetail } from './type';
2
2
  export interface IRewardAdContext {
3
3
  beforeAd?: () => void;
4
4
  beforeReward: (showAdFn: () => void) => void;
5
5
  adDismissed: () => void;
6
6
  adViewed: () => void;
7
7
  afterAd?: () => void;
8
- adBreakDone?: (breakStatus: BreakStatus) => void;
8
+ adBreakDone?: (breakStatus: BreakStatus, detail?: BreakStatusDetail) => void;
9
9
  }
10
10
  /**
11
11
  * RewardAdManager class for managing Google GPT rewarded ads.
@@ -30,7 +30,7 @@ export declare class RewardAdManager {
30
30
  * The init function will potentially request an ad in the background.
31
31
  */
32
32
  private init;
33
- destroy: (breakStatus: BreakStatus) => void;
33
+ destroy: (breakStatus: BreakStatus, detail?: BreakStatusDetail) => void;
34
34
  /**
35
35
  * Destroy the rewarded ad and cleans up resources.
36
36
  *
@@ -39,7 +39,7 @@ export declare class RewardAdManager {
39
39
  *
40
40
  * @param breakStatus The reason for ending the ad.
41
41
  */
42
- reinit: (breakStatus: BreakStatus) => void;
42
+ reinit: (breakStatus: BreakStatus, detail?: BreakStatusDetail) => void;
43
43
  private handleSlotReady;
44
44
  private handleSlotClosed;
45
45
  private handleSlotGranted;
@@ -1 +1,5 @@
1
1
  export type BreakStatus = 'notReady' | 'timeout' | 'error' | 'noAdPreloaded' | 'frequencyCapped' | 'ignored' | 'other' | 'dismissed' | 'viewed';
2
+ export interface BreakStatusDetail {
3
+ breakReason?: 'gpt_interstitial_not_ready' | 'gpt_reward_empty_render' | 'reward_not_completed';
4
+ breakStage?: 'provider_request' | 'ad_terminal';
5
+ }
@@ -1,10 +1,10 @@
1
1
  import { IAdsContext } from '@/type/base';
2
2
  import { NativeProviderConfig } from './native-helper';
3
- import { BreakStatus } from './type';
3
+ import { BreakStatus, BreakStatusDetail } from './type';
4
4
  export interface INativeInterstitialAdContext {
5
5
  beforeAd?: () => void;
6
6
  afterAd?: () => void;
7
- onEnd?: (endReason: BreakStatus) => void;
7
+ onEnd?: (endReason: BreakStatus, detail?: BreakStatusDetail) => void;
8
8
  }
9
9
  /**
10
10
  * NativeInterstitialAdManager class for managing native interstitial ads.
@@ -30,14 +30,14 @@ export declare class NativeInterstitialAdManager {
30
30
  * @param endReason The reason for ending the current ad session.
31
31
  * @param clearContext Whether to clear the adsContext.
32
32
  */
33
- destroy: (endReason: BreakStatus, clearContext?: boolean) => void;
33
+ destroy: (endReason: BreakStatus, clearContext?: boolean, detail?: BreakStatusDetail) => void;
34
34
  /**
35
35
  * Re-initializes the ad manager.
36
36
  *
37
37
  * @param endReason The reason for re-init.
38
38
  * @param clearContext Whether to clear the adsContext.
39
39
  */
40
- reinit: (endReason: BreakStatus, clearContext?: boolean) => Promise<void>;
40
+ reinit: (endReason: BreakStatus, clearContext?: boolean, detail?: BreakStatusDetail) => Promise<void>;
41
41
  /**
42
42
  * Request ads for the native interstitial ad.
43
43
  *
@@ -1,13 +1,13 @@
1
1
  import { IAdsContext } from '@/type/base';
2
2
  import { NativeProviderConfig } from './native-helper';
3
- import { BreakStatus } from './type';
3
+ import { BreakStatus, BreakStatusDetail } from './type';
4
4
  export interface INativeRewardAdContext {
5
5
  beforeAd?: () => void;
6
6
  beforeReward: (showAdFn: () => void) => void;
7
7
  adDismissed: () => void;
8
8
  adViewed: () => void;
9
9
  afterAd?: () => void;
10
- adBreakDone?: (breakStatus: BreakStatus) => void;
10
+ adBreakDone?: (breakStatus: BreakStatus, detail?: BreakStatusDetail) => void;
11
11
  }
12
12
  /**
13
13
  * NativeRewardAdManager class for managing native rewarded ads.
@@ -32,13 +32,13 @@ export declare class NativeRewardAdManager {
32
32
  *
33
33
  * @param breakStatus The reason for ending the current ad session.
34
34
  */
35
- destroy: (breakStatus: BreakStatus) => void;
35
+ destroy: (breakStatus: BreakStatus, detail?: BreakStatusDetail) => void;
36
36
  /**
37
37
  * Re-initializes the ad manager.
38
38
  *
39
39
  * @param breakStatus The reason for re-init.
40
40
  */
41
- reinit: (breakStatus: BreakStatus) => Promise<void>;
41
+ reinit: (breakStatus: BreakStatus, detail?: BreakStatusDetail) => Promise<void>;
42
42
  /**
43
43
  * Request ads for the native rewarded ad.
44
44
  *
@@ -1 +1,5 @@
1
1
  export type BreakStatus = 'notReady' | 'timeout' | 'error' | 'noAdPreloaded' | 'frequencyCapped' | 'ignored' | 'other' | 'dismissed' | 'viewed';
2
+ export interface BreakStatusDetail {
3
+ breakReason?: 'native_interstitial_not_ready' | 'native_reward_not_ready' | 'native_show_failed' | 'reward_not_completed' | 'interstitial_dismissed';
4
+ breakStage?: 'provider_request' | 'native_show' | 'ad_terminal';
5
+ }