react-native-applovin-max 9.0.0 → 9.2.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.
Files changed (147) hide show
  1. package/android/build.gradle +3 -3
  2. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdView.java +4 -10
  3. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdViewUiComponent.java +17 -8
  4. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXModuleImpl.java +36 -14
  5. package/android/src/newarch/com/applovin/reactnative/AppLovinMAXModule.java +6 -6
  6. package/android/src/oldarch/com/applovin/reactnative/AppLovinMAXModule.java +6 -6
  7. package/ios/AppLovinMAX.mm +36 -13
  8. package/ios/AppLovinMAXAdView.h +1 -0
  9. package/ios/AppLovinMAXAdView.mm +3 -9
  10. package/ios/AppLovinMAXAdViewUIComponent.h +1 -2
  11. package/ios/AppLovinMAXAdViewUIComponent.mm +18 -10
  12. package/lib/commonjs/AdView.js +63 -79
  13. package/lib/commonjs/AdView.js.map +1 -1
  14. package/lib/commonjs/AppLovinMAX.js +43 -29
  15. package/lib/commonjs/AppLovinMAX.js.map +1 -1
  16. package/lib/commonjs/BannerAd.js +2 -3
  17. package/lib/commonjs/BannerAd.js.map +1 -1
  18. package/lib/commonjs/ErrorCode.js +24 -31
  19. package/lib/commonjs/ErrorCode.js.map +1 -1
  20. package/lib/commonjs/EventEmitter.js +22 -1
  21. package/lib/commonjs/EventEmitter.js.map +1 -1
  22. package/lib/commonjs/Utils.js +22 -4
  23. package/lib/commonjs/Utils.js.map +1 -1
  24. package/lib/commonjs/index.js +1 -2
  25. package/lib/commonjs/index.js.map +1 -1
  26. package/lib/commonjs/nativeAd/NativeAdView.js +34 -24
  27. package/lib/commonjs/nativeAd/NativeAdView.js.map +1 -1
  28. package/lib/commonjs/nativeAd/NativeAdViewComponents.js +85 -43
  29. package/lib/commonjs/nativeAd/NativeAdViewComponents.js.map +1 -1
  30. package/lib/commonjs/nativeAd/NativeAdViewProvider.js +30 -2
  31. package/lib/commonjs/nativeAd/NativeAdViewProvider.js.map +1 -1
  32. package/lib/commonjs/specs/AppLovinMAXAdViewNativeComponent.js +27 -0
  33. package/lib/commonjs/specs/AppLovinMAXAdViewNativeComponent.js.map +1 -1
  34. package/lib/commonjs/specs/AppLovinMAXNativeAdViewNativeComponent.js +23 -0
  35. package/lib/commonjs/specs/AppLovinMAXNativeAdViewNativeComponent.js.map +1 -1
  36. package/lib/commonjs/specs/NativeAppLovinMAXModule.js +7 -0
  37. package/lib/commonjs/specs/NativeAppLovinMAXModule.js.map +1 -1
  38. package/lib/commonjs/types/AdInfo.js +13 -16
  39. package/lib/commonjs/types/AdInfo.js.map +1 -1
  40. package/lib/module/AdView.js +62 -77
  41. package/lib/module/AdView.js.map +1 -1
  42. package/lib/module/AppLovinMAX.js +44 -29
  43. package/lib/module/AppLovinMAX.js.map +1 -1
  44. package/lib/module/BannerAd.js +2 -3
  45. package/lib/module/BannerAd.js.map +1 -1
  46. package/lib/module/ErrorCode.js +24 -31
  47. package/lib/module/ErrorCode.js.map +1 -1
  48. package/lib/module/EventEmitter.js +22 -1
  49. package/lib/module/EventEmitter.js.map +1 -1
  50. package/lib/module/Utils.js +22 -4
  51. package/lib/module/Utils.js.map +1 -1
  52. package/lib/module/nativeAd/NativeAdView.js +34 -21
  53. package/lib/module/nativeAd/NativeAdView.js.map +1 -1
  54. package/lib/module/nativeAd/NativeAdViewComponents.js +87 -40
  55. package/lib/module/nativeAd/NativeAdViewComponents.js.map +1 -1
  56. package/lib/module/nativeAd/NativeAdViewProvider.js +30 -0
  57. package/lib/module/nativeAd/NativeAdViewProvider.js.map +1 -1
  58. package/lib/module/specs/AppLovinMAXAdViewNativeComponent.js +28 -0
  59. package/lib/module/specs/AppLovinMAXAdViewNativeComponent.js.map +1 -1
  60. package/lib/module/specs/AppLovinMAXNativeAdViewNativeComponent.js +24 -0
  61. package/lib/module/specs/AppLovinMAXNativeAdViewNativeComponent.js.map +1 -1
  62. package/lib/module/specs/NativeAppLovinMAXModule.js +9 -0
  63. package/lib/module/specs/NativeAppLovinMAXModule.js.map +1 -1
  64. package/lib/module/types/AdInfo.js +13 -16
  65. package/lib/module/types/AdInfo.js.map +1 -1
  66. package/lib/typescript/src/AdView.d.ts +27 -21
  67. package/lib/typescript/src/AdView.d.ts.map +1 -1
  68. package/lib/typescript/src/AppLovinMAX.d.ts +22 -21
  69. package/lib/typescript/src/AppLovinMAX.d.ts.map +1 -1
  70. package/lib/typescript/src/BannerAd.d.ts.map +1 -1
  71. package/lib/typescript/src/ErrorCode.d.ts +24 -31
  72. package/lib/typescript/src/ErrorCode.d.ts.map +1 -1
  73. package/lib/typescript/src/EventEmitter.d.ts +16 -0
  74. package/lib/typescript/src/EventEmitter.d.ts.map +1 -1
  75. package/lib/typescript/src/Utils.d.ts +15 -0
  76. package/lib/typescript/src/Utils.d.ts.map +1 -1
  77. package/lib/typescript/src/nativeAd/NativeAdView.d.ts +15 -7
  78. package/lib/typescript/src/nativeAd/NativeAdView.d.ts.map +1 -1
  79. package/lib/typescript/src/nativeAd/NativeAdViewComponents.d.ts +65 -1
  80. package/lib/typescript/src/nativeAd/NativeAdViewComponents.d.ts.map +1 -1
  81. package/lib/typescript/src/nativeAd/NativeAdViewProvider.d.ts +17 -0
  82. package/lib/typescript/src/nativeAd/NativeAdViewProvider.d.ts.map +1 -1
  83. package/lib/typescript/src/specs/AppLovinMAXAdViewNativeComponent.d.ts +45 -1
  84. package/lib/typescript/src/specs/AppLovinMAXAdViewNativeComponent.d.ts.map +1 -1
  85. package/lib/typescript/src/specs/AppLovinMAXNativeAdViewNativeComponent.d.ts +57 -6
  86. package/lib/typescript/src/specs/AppLovinMAXNativeAdViewNativeComponent.d.ts.map +1 -1
  87. package/lib/typescript/src/specs/NativeAppLovinMAXModule.d.ts +13 -3
  88. package/lib/typescript/src/specs/NativeAppLovinMAXModule.d.ts.map +1 -1
  89. package/lib/typescript/src/types/AdEvent.d.ts +10 -4
  90. package/lib/typescript/src/types/AdEvent.d.ts.map +1 -1
  91. package/lib/typescript/src/types/AdInfo.d.ts +78 -85
  92. package/lib/typescript/src/types/AdInfo.d.ts.map +1 -1
  93. package/lib/typescript/src/types/AdProps.d.ts +14 -15
  94. package/lib/typescript/src/types/AdProps.d.ts.map +1 -1
  95. package/lib/typescript/src/types/AdViewProps.d.ts +32 -29
  96. package/lib/typescript/src/types/AdViewProps.d.ts.map +1 -1
  97. package/lib/typescript/src/types/AppLovinMAX.d.ts +50 -53
  98. package/lib/typescript/src/types/AppLovinMAX.d.ts.map +1 -1
  99. package/lib/typescript/src/types/BannerAd.d.ts +24 -18
  100. package/lib/typescript/src/types/BannerAd.d.ts.map +1 -1
  101. package/lib/typescript/src/types/CMPError.d.ts +7 -4
  102. package/lib/typescript/src/types/CMPError.d.ts.map +1 -1
  103. package/lib/typescript/src/types/Configuration.d.ts +12 -14
  104. package/lib/typescript/src/types/Configuration.d.ts.map +1 -1
  105. package/lib/typescript/src/types/FullscreenAd.d.ts +39 -46
  106. package/lib/typescript/src/types/FullscreenAd.d.ts.map +1 -1
  107. package/lib/typescript/src/types/MRecAd.d.ts +7 -3
  108. package/lib/typescript/src/types/MRecAd.d.ts.map +1 -1
  109. package/lib/typescript/src/types/NativeAd.d.ts +12 -11
  110. package/lib/typescript/src/types/NativeAd.d.ts.map +1 -1
  111. package/lib/typescript/src/types/NativeAdViewProps.d.ts +4 -3
  112. package/lib/typescript/src/types/NativeAdViewProps.d.ts.map +1 -1
  113. package/lib/typescript/src/types/Privacy.d.ts +13 -6
  114. package/lib/typescript/src/types/Privacy.d.ts.map +1 -1
  115. package/lib/typescript/src/types/RewardedAd.d.ts +7 -5
  116. package/lib/typescript/src/types/RewardedAd.d.ts.map +1 -1
  117. package/lib/typescript/src/types/ViewAd.d.ts +46 -50
  118. package/lib/typescript/src/types/ViewAd.d.ts.map +1 -1
  119. package/package.json +1 -1
  120. package/react-native-applovin-max.podspec +2 -2
  121. package/src/AdView.tsx +64 -82
  122. package/src/AppLovinMAX.ts +39 -29
  123. package/src/BannerAd.ts +2 -3
  124. package/src/ErrorCode.ts +24 -31
  125. package/src/EventEmitter.ts +20 -2
  126. package/src/Utils.ts +20 -1
  127. package/src/nativeAd/NativeAdView.tsx +31 -21
  128. package/src/nativeAd/NativeAdViewComponents.tsx +97 -38
  129. package/src/nativeAd/NativeAdViewProvider.tsx +23 -0
  130. package/src/specs/AppLovinMAXAdViewNativeComponent.ts +62 -1
  131. package/src/specs/AppLovinMAXNativeAdViewNativeComponent.ts +70 -6
  132. package/src/specs/NativeAppLovinMAXModule.ts +77 -56
  133. package/src/types/AdEvent.ts +10 -4
  134. package/src/types/AdInfo.ts +78 -85
  135. package/src/types/AdProps.ts +14 -15
  136. package/src/types/AdViewProps.ts +33 -29
  137. package/src/types/AppLovinMAX.ts +50 -53
  138. package/src/types/BannerAd.ts +24 -18
  139. package/src/types/CMPError.ts +7 -4
  140. package/src/types/Configuration.ts +12 -14
  141. package/src/types/FullscreenAd.ts +39 -46
  142. package/src/types/MRecAd.ts +7 -3
  143. package/src/types/NativeAd.ts +12 -11
  144. package/src/types/NativeAdViewProps.ts +4 -3
  145. package/src/types/Privacy.ts +13 -6
  146. package/src/types/RewardedAd.ts +7 -5
  147. package/src/types/ViewAd.ts +46 -50
@@ -3,154 +3,151 @@ import type { CMPError } from './CMPError';
3
3
  import type { ConsentFlowUserGeography } from '../AppLovinMAX';
4
4
 
5
5
  /**
6
- * Represents the AppLovinMAX module.
6
+ * Defines the AppLovin MAX module interface exposed to JavaScript.
7
7
  */
8
8
  export type AppLovinMAXType = {
9
9
  /**
10
- * Indicates whether or not the AppLovinMAX SDK has fully initialized without errors and
11
- * {@link AppLovinMAX.initialize()} has called the completion callback.
10
+ * Checks whether the AppLovin MAX SDK has finished initializing.
11
+ *
12
+ * @returns A promise that resolves to `true` if the SDK is initialized, or `false` otherwise.
12
13
  */
13
14
  isInitialized(): Promise<boolean>;
14
15
 
15
16
  /**
16
- * Initializes the AppLovinMAX SDK, and returns {@link Configuration} when it finishes initializing.
17
+ * Initializes the AppLovin MAX SDK.
17
18
  *
18
- * @param sdkKey SDK key to use for the instance of the AppLovinMAX SDK.
19
+ * @param sdkKey - Your AppLovin SDK key.
20
+ * @returns A promise that resolves with the initialization configuration.
19
21
  */
20
22
  initialize(sdkKey: string): Promise<Configuration>;
21
23
 
22
24
  /**
23
- * Sets a list of the ad units for the SDK to initialize only those networks.
25
+ * Restricts initialization to the specified ad unit IDs only.
24
26
  *
25
- * @param adUnitIds Ad units to be initialized with the SDK.
27
+ * @param adUnitIds - An array of ad unit IDs to initialize.
26
28
  */
27
29
  setInitializationAdUnitIds(adUnitIds: string[]): void;
28
30
 
29
31
  /**
30
- * Presents the mediation debugger UI.
32
+ * Displays the AppLovin Mediation Debugger UI.
31
33
  */
32
34
  showMediationDebugger(): void;
33
35
 
34
36
  /**
35
- * Whether this device is a tablet.
37
+ * Checks whether the current device is a tablet.
38
+ *
39
+ * @returns A promise that resolves to `true` if the device is a tablet.
36
40
  */
37
41
  isTablet(): Promise<boolean>;
38
42
 
39
43
  /**
40
- * Sets an ID for the current user. AppLovin ties this identifier to SDK events and AppLovin’s
41
- * optional S2S postbacks.
44
+ * Sets a user ID for use in SDK events and S2S postbacks.
42
45
  *
43
- * @param userId User id.
46
+ * @param userId - The custom user ID to associate with this device.
44
47
  */
45
48
  setUserId(userId: string): void;
46
49
 
47
50
  /**
48
- * Sets a muted state (or not) as the initial state for video ads.
51
+ * Sets whether video ads should start in a muted state.
49
52
  *
50
- * @param muted If ads should begin in a muted state.
53
+ * @param muted - `true` to mute ads by default.
51
54
  */
52
55
  setMuted(muted: boolean): void;
53
56
 
54
57
  /**
55
- * Whether to begin video ads in a muted state or not.
58
+ * Gets whether video ads will start muted.
59
+ *
60
+ * @returns A promise that resolves to `true` if ads will begin muted.
56
61
  */
57
62
  isMuted(): Promise<boolean>;
58
63
 
59
64
  /**
60
- * A toggle for verbose logging for the AppLovinMAX SDK.
65
+ * Enables or disables verbose logging in the AppLovin MAX SDK.
61
66
  *
62
- * @param verboseLoggingEnabled true if the AppLovinMAX SDK should output log messages.
67
+ * @param verboseLoggingEnabled - `true` to enable verbose logs.
63
68
  */
64
69
  setVerboseLogging(verboseLoggingEnabled: boolean): void;
65
70
 
66
71
  /**
67
- * Enables devices to receive test ads by passing in the advertising identifier (IDFA or IDFV) of
68
- * each test device. Refer to AppLovin logs for the IDFA or IDFV of your current device.
72
+ * Registers test devices using their advertising IDs (IDFA/IDFV).
69
73
  *
70
- * @param advertisingIds A list of the advertising ids.
74
+ * @param advertisingIds - An array of advertising IDs to register.
71
75
  */
72
76
  setTestDeviceAdvertisingIds(advertisingIds: string[]): void;
73
77
 
74
78
  /**
75
- * Whether the Creative Debugger displays after you flip the device screen down twice.
79
+ * Enables or disables the Creative Debugger gesture (flip screen down twice).
76
80
  *
77
- * @param enabled Default to true.
81
+ * @param enabled - `true` to enable the Creative Debugger (default: true).
78
82
  */
79
83
  setCreativeDebuggerEnabled(enabled: boolean): void;
80
84
 
81
85
  /**
82
- * Sets an extra parameter to pass to the AppLovin server.
86
+ * Sets an extra parameter to send with SDK requests.
83
87
  *
84
- * @param key Parameter key.
85
- * @param value Parameter value.
88
+ * @param key - The name of the parameter.
89
+ * @param value - The value of the parameter, or `null` to clear it.
86
90
  */
87
91
  setExtraParameter(key: string, value: string | null): void;
88
92
 
89
93
  /**
90
- * Enables the MAX Terms and Privacy Policy Flow.
94
+ * Enables the AppLovin MAX Terms and Privacy Policy flow.
91
95
  *
92
- * @param enabled true to enable the MAX Terms and Privacy Policy Flow.
96
+ * @param enabled - `true` to enable the flow.
93
97
  */
94
98
  setTermsAndPrivacyPolicyFlowEnabled(enabled: boolean): void;
95
99
 
96
100
  /**
97
- * The URL of your company’s privacy policy, as a string. This is required in order to enable
98
- * the Terms Flow.
101
+ * Sets the URL for your company’s privacy policy (required to enable the terms flow).
99
102
  *
100
- * @param urlString The URL string to point your company’s privacy policy.
103
+ * @param urlString - A valid URL string to your privacy policy.
101
104
  */
102
105
  setPrivacyPolicyUrl(urlString: string): void;
103
106
 
104
107
  /**
105
- * The URL of your company’s terms of service, as a string. This is optional; you can enable
106
- * the Terms Flow with or without it.
108
+ * Sets the URL for your company’s terms of service (optional).
107
109
  *
108
- * @param urlString The URL string to point your company’s terms of service.
110
+ * @param urlString - A valid URL string to your terms of service.
109
111
  */
110
112
  setTermsOfServiceUrl(urlString: string): void;
111
113
 
112
114
  /**
113
- * Set debug user geography. You may use this to test CMP flow by setting this to {@link ConsentFlowUserGeography.GDPR}.
115
+ * Sets a mock geography for testing the CMP flow (e.g., GDPR).
114
116
  *
115
- * @note The debug geography is used only when the app is in debug mode.
117
+ * @note This only applies when running the app in debug mode.
118
+ *
119
+ * @param userGeography - The mock user geography to simulate.
116
120
  */
117
121
  setConsentFlowDebugUserGeography(userGeography: ConsentFlowUserGeography): void;
118
122
 
119
123
  /**
120
- * Shows the CMP flow to an existing user.
121
- * Note that this resets the user’s existing consent information.
122
- *
123
- * The function returns when the flow finishes showing. On success, returns null. On failure,
124
- * returns one of the {@link CMPError} codes.
124
+ * Displays the CMP flow for an existing user and resets their consent status.
125
125
  *
126
- * @return {Promise<CMPError|null>}
126
+ * @returns A promise that resolves to `null` on success, or a {@link CMPError} on failure.
127
127
  */
128
128
  showCmpForExistingUser(): Promise<CMPError | null>;
129
129
 
130
130
  /**
131
- * Returns true if a supported CMP SDK is detected.
131
+ * Checks if a supported CMP SDK is available.
132
132
  *
133
- * @return {boolean}
133
+ * @returns A promise that resolves to `true` if a CMP is detected.
134
134
  */
135
135
  hasSupportedCmp(): Promise<boolean>;
136
136
 
137
137
  /**
138
- * Adds a segment. Both the key and the values must be integers.
138
+ * Adds a new user segment.
139
139
  *
140
- * @param key An integer key.
141
- * @param values An array of integers.
142
- * @returns A promise that resolves upon the successful addition. The resolved object contains
143
- * void.
144
- * @throws Throws an error if the segments can not be added.
140
+ * @param key - An integer key identifying the segment.
141
+ * @param values - An array of integer values for the segment.
142
+ * @returns A promise that resolves on success, or rejects if the operation fails.
145
143
  */
146
144
  addSegment(key: number, values: number[]): Promise<void>;
147
145
 
148
146
  /**
149
- * Returns a list of segments.
147
+ * Retrieves the list of user segments.
150
148
  *
151
- * @returns A promise that resolves upon a successful inquiry. The resolved object contains a
152
- * Map object that holds a list of segments, each represented by a key and an array of integers.
153
- * @throws Throws an error if the segments can not be gotten.
149
+ * @returns A promise that resolves to a map of segment keys to arrays of values,
150
+ * or `null` if no segments are available.
154
151
  */
155
152
  getSegments(): Promise<Map<number, number[]> | null>;
156
153
  };
@@ -1,46 +1,52 @@
1
1
  import type { ViewAdType } from './ViewAd';
2
2
  import type { AdViewPosition } from '../AdView';
3
3
 
4
+ /**
5
+ * Defines the interface for managing banner ads.
6
+ * Extends {@link ViewAdType} with banner-specific layout and customization methods.
7
+ */
4
8
  export type BannerAdType = ViewAdType & {
5
9
  /**
6
- * Creates a banner at the specified position and offsets.
10
+ * Creates a banner ad at the specified position and optional pixel offsets.
7
11
  *
8
- * @param adUnitId The Ad Unit ID to load ads for.
9
- * @param position {@ AdViewPosition} position.
10
- * @param xOffset Horizontal offset from the left position.
11
- * @param yOffset Vertical offset from the top position.
12
+ * @param adUnitId - The ad unit ID to load ads for.
13
+ * @param position - The position of the banner on screen.
14
+ * @param xOffset - Optional horizontal offset from the left (default: 0).
15
+ * @param yOffset - Optional vertical offset from the top (default: 0).
16
+ * @param isAdaptive - Optional flag to enable adaptive banners (default: true).
12
17
  */
13
- createAd(adUnitId: string, position: AdViewPosition, xOffset?: number, yOffset?: number): void;
18
+ createAd(adUnitId: string, position: AdViewPosition, xOffset?: number, yOffset?: number, isAdaptive?: boolean): void;
14
19
 
15
20
  /**
16
- * Sets a background color for the banner.
21
+ * Sets the background color of the banner.
17
22
  *
18
- * @param adUnitId The Ad Unit ID to load ads for.
19
- * @param hexColorCode Hexadecimal color (#rrggbb).
23
+ * @param adUnitId - The ad unit ID of the banner.
24
+ * @param hexColorCode - A hex color string (e.g. "#FFFFFF").
20
25
  */
21
26
  setBackgroundColor(adUnitId: string, hexColorCode: string): void;
22
27
 
23
28
  /**
24
- * Sets the banner width.
29
+ * Sets the width of the banner.
25
30
  *
26
- * @param adUnitId The Ad Unit ID to load ads for.
27
- * @param width The desired banner width.
31
+ * @param adUnitId - The ad unit ID of the banner.
32
+ * @param width - Desired width in pixels.
28
33
  */
29
34
  setWidth(adUnitId: string, width: number): void;
30
35
 
31
36
  /**
32
- * Updates the banner position offsets.
37
+ * Updates the position offsets of the banner after creation.
33
38
  *
34
- * @param adUnitId The Ad Unit ID to load ads for.
35
- * @param xOffset Horizontal offset from the left position.
36
- * @param yOffset Vertical offset from the top position.
39
+ * @param adUnitId - The ad unit ID of the banner.
40
+ * @param xOffset - Horizontal offset from the left.
41
+ * @param yOffset - Vertical offset from the top.
37
42
  */
38
43
  updateOffsets(adUnitId: string, xOffset: number, yOffset: number): void;
39
44
 
40
45
  /**
41
- * Gets the adaptive banner size for the provided width at the current orientation.
46
+ * Calculates the adaptive banner height for the given width and current screen orientation.
42
47
  *
43
- * @param width The banner width.
48
+ * @param width - The banner width in pixels.
49
+ * @returns A promise that resolves with the appropriate height.
44
50
  */
45
51
  getAdaptiveHeightForWidth(width: number): Promise<number>;
46
52
  };
@@ -1,23 +1,26 @@
1
1
  import type { CMPErrorCode } from '../AppLovinMAX';
2
2
 
3
+ /**
4
+ * Represents an error returned from the Consent Management Platform (CMP) flow.
5
+ */
3
6
  export type CMPError = {
4
7
  /**
5
- * The error code for this error.
8
+ * The AppLovin-defined CMP error code.
6
9
  */
7
10
  code: CMPErrorCode;
8
11
 
9
12
  /**
10
- * The error message for this error.
13
+ * A descriptive error message from the AppLovin SDK.
11
14
  */
12
15
  message: string;
13
16
 
14
17
  /**
15
- * The error code returned by the CMP.
18
+ * The raw error code returned by the CMP.
16
19
  */
17
20
  cmpCode: number;
18
21
 
19
22
  /**
20
- * The error message returned by the CMP.
23
+ * The raw error message returned by the CMP.
21
24
  */
22
25
  cmpMessage: string;
23
26
  };
@@ -1,36 +1,34 @@
1
1
  import type { ConsentFlowUserGeography, AppTrackingStatus } from '../AppLovinMAX';
2
2
 
3
3
  /**
4
- * Encapsulates data for the AppLovinMAX SDK configuration.
4
+ * Represents the AppLovin MAX SDK configuration returned after initialization.
5
5
  */
6
6
  export type Configuration = {
7
7
  /**
8
- * The country code of this user.
8
+ * The user's country code.
9
9
  */
10
10
  countryCode: string;
11
11
 
12
12
  /**
13
- * The user's geography used to determine the type of consent flow shown to the user. If no
14
- * such determination could be made, {@link ConsentFlowUserGeography.UNKNOWN} will be returned.
13
+ * The user's geographic region used to determine which consent flow to display.
14
+ * Returns {@link ConsentFlowUserGeography.UNKNOWN} if the geography cannot be determined.
15
15
  */
16
16
  consentFlowUserGeography: ConsentFlowUserGeography;
17
17
 
18
18
  /**
19
- * Indicates whether or not the user authorizes access to app-related data that can be used for
20
- * tracking the user or the device.
21
- *
22
- * Note: available only on iOS
19
+ * The user's app tracking transparency status on iOS.
20
+ * Only available on iOS 14+; undefined on Android.
23
21
  */
24
22
  appTrackingStatus?: AppTrackingStatus;
25
23
 
26
24
  /**
27
- * Whether or not test mode is enabled for this session.
25
+ * Indicates whether test mode is enabled for this session.
28
26
  *
29
- * @return {boolean} true in one of the following cases:
30
- * 1. {@link AppLovinMAX.setTestDeviceAdvertisingIds()} was called with current device's GAID prior to SDK initialization.
31
- * 2. Current device was registered as a test device through MAX dashboard -> MAX Test Devices prior to SDK initialization.
32
- * 3. Test mode was manually enabled for this session through the Mediation Debugger during the last session.
33
- * 4. Current device is an emulator.
27
+ * Returns `true` if any of the following conditions are met:
28
+ * - {@link AppLovinMAX.setTestDeviceAdvertisingIds()} was called with the current device's GAID before SDK initialization.
29
+ * - The current device was registered via the MAX dashboard under "Test Devices".
30
+ * - Test mode was manually enabled in the Mediation Debugger in a previous session.
31
+ * - The app is running on an emulator.
34
32
  */
35
33
  isTestModeEnabled: boolean;
36
34
  };
@@ -3,139 +3,132 @@ import type { AdInfo, AdLoadFailedInfo, AdDisplayFailedInfo } from './AdInfo';
3
3
  import type { LocalExtraParameterValue } from './AdProps';
4
4
 
5
5
  /**
6
- * Defines a full-screen ad (i.e Intestitial / Rewarded / AppOpen)
6
+ * Defines the interface for managing full-screen ads such as Interstitial, Rewarded, and AppOpen ads.
7
7
  */
8
8
  export type FullscreenAdType = {
9
9
  /**
10
- * Whether or not this ad is ready to be shown.
10
+ * Checks whether an ad is ready to be shown.
11
11
  *
12
- * @param adUnitId The ad unit ID of the ad to check whether it is ready to be shown.
12
+ * @param adUnitId - The ad unit ID to check.
13
+ * @returns A promise that resolves to `true` if the ad is ready.
13
14
  */
14
15
  isAdReady(adUnitId: string): Promise<boolean>;
15
16
 
16
17
  /**
17
- * Loads an interstitial ad.
18
+ * Loads a full-screen ad for the given ad unit ID.
18
19
  *
19
- * @param adUnitId The ad unit ID to load an ad for.
20
+ * @param adUnitId - The ad unit ID to load.
20
21
  */
21
22
  loadAd(adUnitId: string): void;
22
23
 
23
24
  /**
24
- * Shows the loaded interstitial ad, optionallly for a given placement and custom data to tie ad
25
- * events to.
25
+ * Shows a loaded full-screen ad.
26
26
  *
27
- * @param adUnitId The ad unit ID of the ad to show.
28
- * @param placement The placement to tie the showing ad's events to.
29
- * @param customData The custom data to tie the showing ad's events to. Maximum size is 8KB.
27
+ * @param adUnitId - The ad unit ID of the ad to show.
28
+ * @param placement - Optional placement name for event reporting.
29
+ * @param customData - Optional custom string data (max size: 8 KB).
30
30
  */
31
31
  showAd(adUnitId: string, placement?: string | null, customData?: string | null): void;
32
32
 
33
33
  /**
34
- * Sets an extra key/value parameter for the ad.
34
+ * Sets an extra parameter to pass to the SDK for the specified ad unit.
35
35
  *
36
- * @param adUnitId The ad unit ID of the ad to set a parameter for.
37
- * @param key Parameter key.
38
- * @param value Parameter value.
36
+ * @param adUnitId - The ad unit ID.
37
+ * @param key - The parameter name.
38
+ * @param value - The parameter value or `null` to clear it.
39
39
  */
40
40
  setExtraParameter(adUnitId: string, key: string, value: string | null): void;
41
41
 
42
42
  /**
43
- * Sets a local extra parameter to pass to the adapter instances.
43
+ * Sets a local extra parameter to pass to the adapter for the specified ad unit.
44
44
  *
45
- * @param adUnitId The ad unit ID of the ad to set a local parameter for.
46
- * @param key Parameter key.
47
- * @param value Parameter value.
45
+ * @param adUnitId - The ad unit ID.
46
+ * @param key - The parameter name.
47
+ * @param value - The parameter value (string, number, boolean, object, or null).
48
48
  */
49
49
  setLocalExtraParameter(adUnitId: string, key: string, value: LocalExtraParameterValue): void;
50
50
 
51
51
  /**
52
- * Adds the specified event listener to receive {@link AdInfo} when a full-screen ad loads a new ad.
52
+ * Registers a listener for when an ad is successfully loaded.
53
53
  *
54
- * @param listener Listener to be notified.
54
+ * @param listener - Callback to be notified with {@link AdInfo}.
55
55
  */
56
56
  addAdLoadedEventListener(listener: AdEventListener<AdInfo>): void;
57
57
 
58
58
  /**
59
- * Removes the event listener to receive {@link AdInfo} when a full-screen ad loads a new ad.
59
+ * Unregisters the ad loaded listener.
60
60
  */
61
61
  removeAdLoadedEventListener(): void;
62
62
 
63
63
  /**
64
- * Adds the specified event listener to receive {@link AdLoadFailedInfo} when a full-screen ad
65
- * could not load a new ad.
64
+ * Registers a listener for when an ad fails to load.
66
65
  *
67
- * @param listener Listener to be notified.
66
+ * @param listener - Callback to be notified with {@link AdLoadFailedInfo}.
68
67
  */
69
68
  addAdLoadFailedEventListener(listener: AdEventListener<AdLoadFailedInfo>): void;
70
69
 
71
70
  /**
72
- * Removes the event listener to receive {@ link adLoadFailedInfo} when a full-screen ad could
73
- * not load a new ad.
71
+ * Unregisters the ad load failure listener.
74
72
  */
75
73
  removeAdLoadFailedEventListener(): void;
76
74
 
77
75
  /**
78
- * Adds the specified event listener to receive {@link AdInfo} when the user clicks the ad.
76
+ * Registers a listener for ad click events.
79
77
  *
80
- * @param listener Listener to be notified.
78
+ * @param listener - Callback to be notified with {@link AdInfo}.
81
79
  */
82
80
  addAdClickedEventListener(listener: AdEventListener<AdInfo>): void;
83
81
 
84
82
  /**
85
- * Removes the event listener to receive {@link AdInfo} when the user clicks the ad.
83
+ * Unregisters the ad click listener.
86
84
  */
87
85
  removeAdClickedEventListener(): void;
88
86
 
89
87
  /**
90
- * Adds the specified event listener to receive {@link AdInfo} when a full-screen ad displays the ad.
88
+ * Registers a listener for when an ad is displayed.
91
89
  *
92
- * @param listener Listener to be notified.
90
+ * @param listener - Callback to be notified with {@link AdInfo}.
93
91
  */
94
92
  addAdDisplayedEventListener(listener: AdEventListener<AdInfo>): void;
95
93
 
96
94
  /**
97
- * Removes the event listener to receive {@link AdInfo} when a full-screen ad displays the ad.
95
+ * Unregisters the ad display listener.
98
96
  */
99
97
  removeAdDisplayedEventListener(): void;
100
98
 
101
99
  /**
102
- * Adds the specified event listener to receive {@link AdDisplayFailedInfo} when a full-screen
103
- * ad fails to display the ad.
100
+ * Registers a listener for when an ad fails to display.
104
101
  *
105
- * @param listener Listener to be notified.
102
+ * @param listener - Callback to be notified with {@link AdDisplayFailedInfo}.
106
103
  */
107
104
  addAdFailedToDisplayEventListener(listener: AdEventListener<AdDisplayFailedInfo>): void;
108
105
 
109
106
  /**
110
- * Removes the event listener to receive {@link AdDisplayFailedInfo} when a full-screen ad
111
- * fails to display the ad.
107
+ * Unregisters the ad display failure listener.
112
108
  */
113
109
  removeAdFailedToDisplayEventListener(): void;
114
110
 
115
111
  /**
116
- * Adds the specified event listener to receive {@link AdInfo} when a full-screen ad hides the
117
- * ad.
112
+ * Registers a listener for when an ad is hidden (dismissed).
118
113
  *
119
- * @param listener Listener to be notified.
114
+ * @param listener - Callback to be notified with {@link AdInfo}.
120
115
  */
121
116
  addAdHiddenEventListener(listener: AdEventListener<AdInfo>): void;
122
117
 
123
118
  /**
124
- * Removes the event listener to receive {@link AdInfo} when a full-screen ad hides the ad.
119
+ * Unregisters the ad hidden listener.
125
120
  */
126
121
  removeAdHiddenEventListener(): void;
127
122
 
128
123
  /**
129
- * Adds the specified event listener to receive {@link AdInfo} when a full-screen ad
130
- * pays ad revenue to the publisher.
124
+ * Registers a listener for when ad revenue is paid.
131
125
  *
132
- * @param listener Listener to be notified.
126
+ * @param listener - Callback to be notified with {@link AdInfo}.
133
127
  */
134
128
  addAdRevenuePaidListener(listener: AdEventListener<AdInfo>): void;
135
129
 
136
130
  /**
137
- * Removes the event listener to receive {@link AdInfo} when a full-screen ad pays
138
- * ad revenue to the publisher.
131
+ * Unregisters the ad revenue paid listener.
139
132
  */
140
133
  removeAdRevenuePaidListener(): void;
141
134
  };
@@ -1,12 +1,16 @@
1
1
  import type { ViewAdType } from './ViewAd';
2
2
  import type { AdViewPosition } from '../AdView';
3
3
 
4
+ /**
5
+ * Defines the interface for managing MREC ads.
6
+ * Extends {@link ViewAdType} with MREC-specific creation logic.
7
+ */
4
8
  export type MRecAdType = ViewAdType & {
5
9
  /**
6
- * Creates a MREC at the specified position.
10
+ * Creates an MREC ad at the specified screen position.
7
11
  *
8
- * @param adUnitId The Ad Unit ID to to load ads for.
9
- * @param position {@link AdViewPosition} position.
12
+ * @param adUnitId - The ad unit ID to load the ad for.
13
+ * @param position - The desired position for the MREC, defined by {@link AdViewPosition}.
10
14
  */
11
15
  createAd(adUnitId: string, position: AdViewPosition): void;
12
16
  };
@@ -1,54 +1,55 @@
1
1
  /**
2
- * Represents a native ad for rendering in {@link NativeAdView}. This type is intended for internal use only.
2
+ * Represents the structure of a native ad used internally by {@link NativeAdView}.
3
+ * This type is intended for internal use only.
3
4
  */
4
5
  export type NativeAd = {
5
6
  /**
6
- * The native ad title text.
7
+ * The ad title text.
7
8
  */
8
9
  title?: string | null;
9
10
 
10
11
  /**
11
- * The native ad advertiser text.
12
+ * The advertiser name.
12
13
  */
13
14
  advertiser?: string | null;
14
15
 
15
16
  /**
16
- * The native ad body text.
17
+ * The ad body text.
17
18
  */
18
19
  body?: string | null;
19
20
 
20
21
  /**
21
- * The native ad CTA button text.
22
+ * The call-to-action text.
22
23
  */
23
24
  callToAction?: string | null;
24
25
 
25
26
  /**
26
- * Whether or not this has an image icon.
27
+ * Indicates whether an icon image is available.
27
28
  */
28
29
  image?: boolean;
29
30
 
30
31
  /**
31
- * The data of the icon.
32
+ * The base64-encoded image source for the icon (if provided inline).
32
33
  */
33
34
  imageSource?: string | null;
34
35
 
35
36
  /**
36
- * The URL string of the icon.
37
+ * The URL of the icon image.
37
38
  */
38
39
  url?: string;
39
40
 
40
41
  /**
41
- * The star rating of the native ad.
42
+ * The star rating of the ad, typically in the range [0.0 – 5.0].
42
43
  */
43
44
  starRating?: number;
44
45
 
45
46
  /**
46
- * Whether or not the Options view is available.
47
+ * Whether the native Options view is available.
47
48
  */
48
49
  isOptionsViewAvailable: boolean;
49
50
 
50
51
  /**
51
- * Whether or not the Media view is available.
52
+ * Whether the native Media view (video or image) is available.
52
53
  */
53
54
  isMediaViewAvailable: boolean;
54
55
  };
@@ -1,16 +1,17 @@
1
1
  import type { AdProps } from './AdProps';
2
2
 
3
3
  /**
4
- * A handler of {@link NativeAdView}.
4
+ * A reference handler for the {@link NativeAdView} component.
5
5
  */
6
6
  export type NativeAdViewHandler = {
7
7
  /**
8
- * Loads a native ad.
8
+ * Triggers a native ad load.
9
9
  */
10
10
  loadAd(): void;
11
11
  };
12
12
 
13
13
  /**
14
- * Represents a {@link NativeAdView}.
14
+ * Props passed to the {@link NativeAdView} component.
15
+ * Extends the base {@link AdProps} used for all ad components.
15
16
  */
16
17
  export type NativeAdViewProps = AdProps;