react-native-applovin-max 8.2.0 → 9.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.
Files changed (196) hide show
  1. package/android/build.gradle +14 -3
  2. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdView.java +34 -27
  3. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdViewManagerImpl.java +110 -0
  4. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdViewUiComponent.java +15 -13
  5. package/android/src/main/java/com/applovin/reactnative/{AppLovinMAXModule.java → AppLovinMAXModuleImpl.java} +108 -168
  6. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXNativeAdView.java +84 -56
  7. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXNativeAdViewManagerImpl.java +101 -0
  8. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXPackage.java +44 -11
  9. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXUtils.java +56 -0
  10. package/android/src/newarch/com/applovin/reactnative/AppLovinMAXAdViewManager.java +151 -0
  11. package/android/src/newarch/com/applovin/reactnative/AppLovinMAXModule.java +453 -0
  12. package/android/src/newarch/com/applovin/reactnative/AppLovinMAXNativeAdViewManager.java +130 -0
  13. package/android/src/oldarch/com/applovin/reactnative/AppLovinMAXAdViewManager.java +128 -0
  14. package/android/src/oldarch/com/applovin/reactnative/AppLovinMAXModule.java +453 -0
  15. package/android/src/oldarch/com/applovin/reactnative/AppLovinMAXNativeAdViewManager.java +93 -0
  16. package/ios/AppLovinMAX.h +8 -3
  17. package/ios/{AppLovinMAX.m → AppLovinMAX.mm} +67 -53
  18. package/ios/AppLovinMAXAdView.h +7 -2
  19. package/ios/AppLovinMAXAdView.mm +747 -0
  20. package/ios/{AppLovinMAXAdViewManager.m → AppLovinMAXAdViewManager.mm} +3 -2
  21. package/ios/{AppLovinMAXAdViewUIComponent.m → AppLovinMAXAdViewUIComponent.mm} +2 -1
  22. package/ios/AppLovinMAXNativeAdView.h +15 -4
  23. package/ios/AppLovinMAXNativeAdView.mm +745 -0
  24. package/ios/AppLovinMAXNativeAdViewManager.mm +116 -0
  25. package/lib/commonjs/AdView.js +102 -142
  26. package/lib/commonjs/AdView.js.map +1 -1
  27. package/lib/commonjs/AppLovinMAX.js +49 -34
  28. package/lib/commonjs/AppLovinMAX.js.map +1 -1
  29. package/lib/commonjs/AppOpenAd.js +8 -10
  30. package/lib/commonjs/AppOpenAd.js.map +1 -1
  31. package/lib/commonjs/BannerAd.js +19 -21
  32. package/lib/commonjs/BannerAd.js.map +1 -1
  33. package/lib/commonjs/ErrorCode.js +27 -36
  34. package/lib/commonjs/ErrorCode.js.map +1 -1
  35. package/lib/commonjs/EventEmitter.js +24 -5
  36. package/lib/commonjs/EventEmitter.js.map +1 -1
  37. package/lib/commonjs/InterstitialAd.js +8 -10
  38. package/lib/commonjs/InterstitialAd.js.map +1 -1
  39. package/lib/commonjs/MRecAd.js +14 -16
  40. package/lib/commonjs/MRecAd.js.map +1 -1
  41. package/lib/commonjs/Privacy.js +3 -5
  42. package/lib/commonjs/Privacy.js.map +1 -1
  43. package/lib/commonjs/RewardedAd.js +8 -10
  44. package/lib/commonjs/RewardedAd.js.map +1 -1
  45. package/lib/commonjs/Utils.js +43 -0
  46. package/lib/commonjs/Utils.js.map +1 -0
  47. package/lib/commonjs/nativeAd/NativeAdView.js +84 -50
  48. package/lib/commonjs/nativeAd/NativeAdView.js.map +1 -1
  49. package/lib/commonjs/nativeAd/NativeAdViewComponents.js +129 -82
  50. package/lib/commonjs/nativeAd/NativeAdViewComponents.js.map +1 -1
  51. package/lib/commonjs/nativeAd/NativeAdViewProvider.js +67 -8
  52. package/lib/commonjs/nativeAd/NativeAdViewProvider.js.map +1 -1
  53. package/lib/commonjs/nativeAd/img/blank_icon.png +0 -0
  54. package/lib/commonjs/specs/AppLovinMAXAdViewNativeComponent.js +41 -0
  55. package/lib/commonjs/specs/AppLovinMAXAdViewNativeComponent.js.map +1 -0
  56. package/lib/commonjs/specs/AppLovinMAXNativeAdViewNativeComponent.js +37 -0
  57. package/lib/commonjs/specs/AppLovinMAXNativeAdViewNativeComponent.js.map +1 -0
  58. package/lib/commonjs/specs/NativeAppLovinMAXModule.js +16 -0
  59. package/lib/commonjs/specs/NativeAppLovinMAXModule.js.map +1 -0
  60. package/lib/commonjs/types/AdInfo.js +13 -16
  61. package/lib/commonjs/types/AdInfo.js.map +1 -1
  62. package/lib/module/AdView.js +98 -139
  63. package/lib/module/AdView.js.map +1 -1
  64. package/lib/module/AppLovinMAX.js +47 -32
  65. package/lib/module/AppLovinMAX.js.map +1 -1
  66. package/lib/module/AppOpenAd.js +1 -4
  67. package/lib/module/AppOpenAd.js.map +1 -1
  68. package/lib/module/BannerAd.js +1 -4
  69. package/lib/module/BannerAd.js.map +1 -1
  70. package/lib/module/ErrorCode.js +25 -35
  71. package/lib/module/ErrorCode.js.map +1 -1
  72. package/lib/module/EventEmitter.js +24 -5
  73. package/lib/module/EventEmitter.js.map +1 -1
  74. package/lib/module/InterstitialAd.js +2 -5
  75. package/lib/module/InterstitialAd.js.map +1 -1
  76. package/lib/module/MRecAd.js +1 -4
  77. package/lib/module/MRecAd.js.map +1 -1
  78. package/lib/module/Privacy.js +1 -4
  79. package/lib/module/Privacy.js.map +1 -1
  80. package/lib/module/RewardedAd.js +2 -5
  81. package/lib/module/RewardedAd.js.map +1 -1
  82. package/lib/module/Utils.js +35 -0
  83. package/lib/module/Utils.js.map +1 -0
  84. package/lib/module/nativeAd/NativeAdView.js +83 -47
  85. package/lib/module/nativeAd/NativeAdView.js.map +1 -1
  86. package/lib/module/nativeAd/NativeAdViewComponents.js +134 -83
  87. package/lib/module/nativeAd/NativeAdViewComponents.js.map +1 -1
  88. package/lib/module/nativeAd/NativeAdViewProvider.js +69 -9
  89. package/lib/module/nativeAd/NativeAdViewProvider.js.map +1 -1
  90. package/lib/module/nativeAd/img/blank_icon.png +0 -0
  91. package/lib/module/specs/AppLovinMAXAdViewNativeComponent.js +35 -0
  92. package/lib/module/specs/AppLovinMAXAdViewNativeComponent.js.map +1 -0
  93. package/lib/module/specs/AppLovinMAXNativeAdViewNativeComponent.js +31 -0
  94. package/lib/module/specs/AppLovinMAXNativeAdViewNativeComponent.js.map +1 -0
  95. package/lib/module/specs/NativeAppLovinMAXModule.js +12 -0
  96. package/lib/module/specs/NativeAppLovinMAXModule.js.map +1 -0
  97. package/lib/module/types/AdInfo.js +13 -16
  98. package/lib/module/types/AdInfo.js.map +1 -1
  99. package/lib/typescript/src/AdView.d.ts +38 -32
  100. package/lib/typescript/src/AdView.d.ts.map +1 -1
  101. package/lib/typescript/src/AppLovinMAX.d.ts +22 -21
  102. package/lib/typescript/src/AppLovinMAX.d.ts.map +1 -1
  103. package/lib/typescript/src/AppOpenAd.d.ts.map +1 -1
  104. package/lib/typescript/src/BannerAd.d.ts.map +1 -1
  105. package/lib/typescript/src/ErrorCode.d.ts +24 -31
  106. package/lib/typescript/src/ErrorCode.d.ts.map +1 -1
  107. package/lib/typescript/src/EventEmitter.d.ts +16 -0
  108. package/lib/typescript/src/EventEmitter.d.ts.map +1 -1
  109. package/lib/typescript/src/InterstitialAd.d.ts.map +1 -1
  110. package/lib/typescript/src/MRecAd.d.ts.map +1 -1
  111. package/lib/typescript/src/Privacy.d.ts.map +1 -1
  112. package/lib/typescript/src/RewardedAd.d.ts.map +1 -1
  113. package/lib/typescript/src/Utils.d.ts +31 -0
  114. package/lib/typescript/src/Utils.d.ts.map +1 -0
  115. package/lib/typescript/src/nativeAd/NativeAdView.d.ts +15 -7
  116. package/lib/typescript/src/nativeAd/NativeAdView.d.ts.map +1 -1
  117. package/lib/typescript/src/nativeAd/NativeAdViewComponents.d.ts +65 -1
  118. package/lib/typescript/src/nativeAd/NativeAdViewComponents.d.ts.map +1 -1
  119. package/lib/typescript/src/nativeAd/NativeAdViewProvider.d.ts +31 -5
  120. package/lib/typescript/src/nativeAd/NativeAdViewProvider.d.ts.map +1 -1
  121. package/lib/typescript/src/specs/AppLovinMAXAdViewNativeComponent.d.ts +130 -0
  122. package/lib/typescript/src/specs/AppLovinMAXAdViewNativeComponent.d.ts.map +1 -0
  123. package/lib/typescript/src/specs/AppLovinMAXNativeAdViewNativeComponent.d.ts +131 -0
  124. package/lib/typescript/src/specs/AppLovinMAXNativeAdViewNativeComponent.d.ts.map +1 -0
  125. package/lib/typescript/src/specs/NativeAppLovinMAXModule.d.ts +142 -0
  126. package/lib/typescript/src/specs/NativeAppLovinMAXModule.d.ts.map +1 -0
  127. package/lib/typescript/src/types/AdEvent.d.ts +10 -4
  128. package/lib/typescript/src/types/AdEvent.d.ts.map +1 -1
  129. package/lib/typescript/src/types/AdInfo.d.ts +79 -86
  130. package/lib/typescript/src/types/AdInfo.d.ts.map +1 -1
  131. package/lib/typescript/src/types/AdProps.d.ts +16 -17
  132. package/lib/typescript/src/types/AdProps.d.ts.map +1 -1
  133. package/lib/typescript/src/types/AdViewProps.d.ts +28 -29
  134. package/lib/typescript/src/types/AdViewProps.d.ts.map +1 -1
  135. package/lib/typescript/src/types/AppLovinMAX.d.ts +50 -53
  136. package/lib/typescript/src/types/AppLovinMAX.d.ts.map +1 -1
  137. package/lib/typescript/src/types/BannerAd.d.ts +22 -17
  138. package/lib/typescript/src/types/BannerAd.d.ts.map +1 -1
  139. package/lib/typescript/src/types/CMPError.d.ts +7 -4
  140. package/lib/typescript/src/types/CMPError.d.ts.map +1 -1
  141. package/lib/typescript/src/types/Configuration.d.ts +12 -14
  142. package/lib/typescript/src/types/Configuration.d.ts.map +1 -1
  143. package/lib/typescript/src/types/FullscreenAd.d.ts +39 -46
  144. package/lib/typescript/src/types/FullscreenAd.d.ts.map +1 -1
  145. package/lib/typescript/src/types/MRecAd.d.ts +7 -3
  146. package/lib/typescript/src/types/MRecAd.d.ts.map +1 -1
  147. package/lib/typescript/src/types/NativeAd.d.ts +15 -10
  148. package/lib/typescript/src/types/NativeAd.d.ts.map +1 -1
  149. package/lib/typescript/src/types/NativeAdViewProps.d.ts +4 -3
  150. package/lib/typescript/src/types/NativeAdViewProps.d.ts.map +1 -1
  151. package/lib/typescript/src/types/Privacy.d.ts +13 -6
  152. package/lib/typescript/src/types/Privacy.d.ts.map +1 -1
  153. package/lib/typescript/src/types/RewardedAd.d.ts +7 -5
  154. package/lib/typescript/src/types/RewardedAd.d.ts.map +1 -1
  155. package/lib/typescript/src/types/ViewAd.d.ts +46 -50
  156. package/lib/typescript/src/types/ViewAd.d.ts.map +1 -1
  157. package/package.json +9 -1
  158. package/react-native-applovin-max.podspec +3 -3
  159. package/src/AdView.tsx +100 -183
  160. package/src/AppLovinMAX.ts +42 -33
  161. package/src/AppOpenAd.ts +1 -3
  162. package/src/BannerAd.ts +1 -3
  163. package/src/ErrorCode.ts +25 -34
  164. package/src/EventEmitter.ts +22 -5
  165. package/src/InterstitialAd.ts +2 -4
  166. package/src/MRecAd.ts +1 -3
  167. package/src/Privacy.ts +1 -3
  168. package/src/RewardedAd.ts +2 -4
  169. package/src/Utils.ts +45 -0
  170. package/src/nativeAd/NativeAdView.tsx +83 -73
  171. package/src/nativeAd/NativeAdViewComponents.tsx +120 -89
  172. package/src/nativeAd/NativeAdViewProvider.tsx +60 -12
  173. package/src/nativeAd/img/blank_icon.png +0 -0
  174. package/src/specs/AppLovinMAXAdViewNativeComponent.ts +157 -0
  175. package/src/specs/AppLovinMAXNativeAdViewNativeComponent.ts +153 -0
  176. package/src/specs/NativeAppLovinMAXModule.ts +228 -0
  177. package/src/types/AdEvent.ts +10 -4
  178. package/src/types/AdInfo.ts +79 -86
  179. package/src/types/AdProps.ts +16 -17
  180. package/src/types/AdViewProps.ts +28 -29
  181. package/src/types/AppLovinMAX.ts +50 -53
  182. package/src/types/BannerAd.ts +22 -17
  183. package/src/types/CMPError.ts +7 -4
  184. package/src/types/Configuration.ts +12 -14
  185. package/src/types/FullscreenAd.ts +39 -46
  186. package/src/types/MRecAd.ts +7 -3
  187. package/src/types/NativeAd.ts +16 -10
  188. package/src/types/NativeAdViewProps.ts +4 -3
  189. package/src/types/Privacy.ts +13 -6
  190. package/src/types/RewardedAd.ts +7 -5
  191. package/src/types/ViewAd.ts +46 -50
  192. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdViewManager.java +0 -149
  193. package/android/src/main/java/com/applovin/reactnative/AppLovinMAXNativeAdViewManager.java +0 -163
  194. package/ios/AppLovinMAXAdView.m +0 -325
  195. package/ios/AppLovinMAXNativeAdView.m +0 -432
  196. package/ios/AppLovinMAXNativeAdViewManager.m +0 -64
@@ -0,0 +1,228 @@
1
+ import { TurboModuleRegistry } from 'react-native';
2
+ import type { TurboModule } from 'react-native';
3
+ import type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
4
+ import type { Configuration } from '../types';
5
+ import type { CMPError } from '../types';
6
+ import type { AdViewId } from '../types';
7
+
8
+ /**
9
+ * Native TurboModule interface for AppLovin MAX.
10
+ * Defines all methods and constants exposed to JavaScript.
11
+ */
12
+ export interface Spec extends TurboModule {
13
+ /**
14
+ * Returns all supported event constants and SDK error codes.
15
+ */
16
+ readonly getConstants: () => {
17
+ // Interstitial ad events
18
+ ON_INTERSTITIAL_LOADED_EVENT: string;
19
+ ON_INTERSTITIAL_LOAD_FAILED_EVENT: string;
20
+ ON_INTERSTITIAL_CLICKED_EVENT: string;
21
+ ON_INTERSTITIAL_DISPLAYED_EVENT: string;
22
+ ON_INTERSTITIAL_AD_FAILED_TO_DISPLAY_EVENT: string;
23
+ ON_INTERSTITIAL_HIDDEN_EVENT: string;
24
+ ON_INTERSTITIAL_AD_REVENUE_PAID: string;
25
+
26
+ // Rewarded ad events
27
+ ON_REWARDED_AD_LOADED_EVENT: string;
28
+ ON_REWARDED_AD_LOAD_FAILED_EVENT: string;
29
+ ON_REWARDED_AD_CLICKED_EVENT: string;
30
+ ON_REWARDED_AD_DISPLAYED_EVENT: string;
31
+ ON_REWARDED_AD_FAILED_TO_DISPLAY_EVENT: string;
32
+ ON_REWARDED_AD_HIDDEN_EVENT: string;
33
+ ON_REWARDED_AD_RECEIVED_REWARD_EVENT: string;
34
+ ON_REWARDED_AD_REVENUE_PAID: string;
35
+
36
+ // Banner ad events
37
+ ON_BANNER_AD_LOADED_EVENT: string;
38
+ ON_BANNER_AD_LOAD_FAILED_EVENT: string;
39
+ ON_BANNER_AD_CLICKED_EVENT: string;
40
+ ON_BANNER_AD_COLLAPSED_EVENT: string;
41
+ ON_BANNER_AD_EXPANDED_EVENT: string;
42
+ ON_BANNER_AD_REVENUE_PAID: string;
43
+
44
+ // MREC ad events
45
+ ON_MREC_AD_LOADED_EVENT: string;
46
+ ON_MREC_AD_LOAD_FAILED_EVENT: string;
47
+ ON_MREC_AD_CLICKED_EVENT: string;
48
+ ON_MREC_AD_COLLAPSED_EVENT: string;
49
+ ON_MREC_AD_EXPANDED_EVENT: string;
50
+ ON_MREC_AD_REVENUE_PAID: string;
51
+
52
+ // App Open ad events
53
+ ON_APPOPEN_AD_LOADED_EVENT: string;
54
+ ON_APPOPEN_AD_LOAD_FAILED_EVENT: string;
55
+ ON_APPOPEN_AD_CLICKED_EVENT: string;
56
+ ON_APPOPEN_AD_DISPLAYED_EVENT: string;
57
+ ON_APPOPEN_AD_FAILED_TO_DISPLAY_EVENT: string;
58
+ ON_APPOPEN_AD_HIDDEN_EVENT: string;
59
+ ON_APPOPEN_AD_REVENUE_PAID: string;
60
+
61
+ // Native UI component ad events
62
+ ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOADED_EVENT: string;
63
+ ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOAD_FAILED_EVENT: string;
64
+
65
+ // Error codes
66
+ MAX_ERROR_CODE_UNSPECIFIED: number;
67
+ MAX_ERROR_CODE_NO_FILL: number;
68
+ MAX_ERROR_CODE_AD_LOAD_FAILED: number;
69
+ MAX_ERROR_CODE_AD_DISPLAY_FAILED: number;
70
+ MAX_ERROR_CODE_NETWORK_ERROR: number;
71
+ MAX_ERROR_CODE_NETWORK_TIMEOUT: number;
72
+ MAX_ERROR_CODE_NO_NETWORK: number;
73
+ MAX_ERROR_CODE_FULLSCREEN_AD_ALREADY_SHOWING: number;
74
+ MAX_ERROR_CODE_FULLSCREEN_AD_NOT_READY: number;
75
+ MAX_ERROR_CODE_FULLSCREEN_AD_INVALID_VIEW_CONTROLLER: number;
76
+ MAX_ERROR_CODE_DONT_KEEP_ACTIVITIES_ENABLED: number;
77
+ MAX_ERROR_CODE_INVALID_AD_UNIT_ID: number;
78
+ };
79
+
80
+ // ─────────────────────────────────────────────────────────
81
+ // SDK Initialization & Configuration
82
+ // ─────────────────────────────────────────────────────────
83
+
84
+ isInitialized(): Promise<boolean>;
85
+ initialize(pluginVersion: string, sdkKey: string): Promise<Configuration>;
86
+ isTablet(): Promise<boolean>;
87
+ showMediationDebugger(): void;
88
+
89
+ // ─────────────────────────────────────────────────────────
90
+ // Privacy & Consent APIs
91
+ // ─────────────────────────────────────────────────────────
92
+
93
+ setHasUserConsent(hasUserConsent: boolean): void;
94
+ hasUserConsent(): Promise<boolean>;
95
+
96
+ setDoNotSell(doNotSell: boolean): void;
97
+ isDoNotSell(): Promise<boolean>;
98
+
99
+ // ─────────────────────────────────────────────────────────
100
+ // User & Debug Settings
101
+ // ─────────────────────────────────────────────────────────
102
+
103
+ setUserId(userId: string): void;
104
+ setMuted(muted: boolean): void;
105
+ isMuted(): Promise<boolean>;
106
+ setVerboseLogging(enabled: boolean): void;
107
+ setCreativeDebuggerEnabled(enabled: boolean): void;
108
+ setTestDeviceAdvertisingIds(ids: string[]): void;
109
+
110
+ // ─────────────────────────────────────────────────────────
111
+ // Extra Parameters
112
+ // ─────────────────────────────────────────────────────────
113
+
114
+ setExtraParameter(key: string, value: string | null): void;
115
+ setInitializationAdUnitIds(adUnitIds: string[]): void;
116
+
117
+ // ─────────────────────────────────────────────────────────
118
+ // CMP (Consent Flow)
119
+ // ─────────────────────────────────────────────────────────
120
+
121
+ setTermsAndPrivacyPolicyFlowEnabled(enabled: boolean): void;
122
+ setPrivacyPolicyUrl(url: string): void;
123
+ setTermsOfServiceUrl(url: string): void;
124
+ setConsentFlowDebugUserGeography(userGeography: string): void;
125
+ showCmpForExistingUser(): Promise<CMPError | null>;
126
+ hasSupportedCmp(): Promise<boolean>;
127
+
128
+ // ─────────────────────────────────────────────────────────
129
+ // Segments
130
+ // ─────────────────────────────────────────────────────────
131
+
132
+ addSegment(key: number, values: number[]): Promise<void>;
133
+ getSegments(): Promise<{ [key: string]: number[] } | null>;
134
+
135
+ // ─────────────────────────────────────────────────────────
136
+ // Banner Ads
137
+ // ─────────────────────────────────────────────────────────
138
+
139
+ createBanner(adUnitId: string, position: string): void;
140
+ createBannerWithOffsets(adUnitId: string, position: string, xOffset: number, yOffset: number): void;
141
+ setBannerBackgroundColor(adUnitId: string, hexColorCode: string): void;
142
+ setBannerPlacement(adUnitId: string, placement: string | null): void;
143
+ setBannerCustomData(adUnitId: string, customData: string | null): void;
144
+ setBannerWidth(adUnitId: string, width: number): void;
145
+ updateBannerPosition(adUnitId: string, position: string): void;
146
+ updateBannerOffsets(adUnitId: string, xOffset: number, yOffset: number): void;
147
+ setBannerExtraParameter(adUnitId: string, key: string, value: string | null): void;
148
+ setBannerLocalExtraParameter(adUnitId: string, parameters: UnsafeObject): void;
149
+ startBannerAutoRefresh(adUnitId: string): void;
150
+ stopBannerAutoRefresh(adUnitId: string): void;
151
+ showBanner(adUnitId: string): void;
152
+ hideBanner(adUnitId: string): void;
153
+ destroyBanner(adUnitId: string): void;
154
+ getAdaptiveBannerHeightForWidth(width: number): Promise<number>;
155
+
156
+ // ─────────────────────────────────────────────────────────
157
+ // MREC Ads
158
+ // ─────────────────────────────────────────────────────────
159
+
160
+ createMRec(adUnitId: string, position: string): void;
161
+ setMRecPlacement(adUnitId: string, placement: string | null): void;
162
+ setMRecCustomData(adUnitId: string, customData: string | null): void;
163
+ updateMRecPosition(adUnitId: string, position: string): void;
164
+ setMRecExtraParameter(adUnitId: string, key: string, value: string | null): void;
165
+ setMRecLocalExtraParameter(adUnitId: string, parameters: UnsafeObject): void;
166
+ startMRecAutoRefresh(adUnitId: string): void;
167
+ stopMRecAutoRefresh(adUnitId: string): void;
168
+ showMRec(adUnitId: string): void;
169
+ hideMRec(adUnitId: string): void;
170
+ destroyMRec(adUnitId: string): void;
171
+
172
+ // ─────────────────────────────────────────────────────────
173
+ // Interstitial Ads
174
+ // ─────────────────────────────────────────────────────────
175
+
176
+ loadInterstitial(adUnitId: string): void;
177
+ isInterstitialReady(adUnitId: string): Promise<boolean>;
178
+ showInterstitial(adUnitId: string, placement?: string | null, customData?: string | null): void;
179
+ setInterstitialExtraParameter(adUnitId: string, key: string, value: string | null): void;
180
+ setInterstitialLocalExtraParameter(adUnitId: string, parameters: UnsafeObject): void;
181
+
182
+ // ─────────────────────────────────────────────────────────
183
+ // Rewarded Ads
184
+ // ─────────────────────────────────────────────────────────
185
+
186
+ loadRewardedAd(adUnitId: string): void;
187
+ isRewardedAdReady(adUnitId: string): Promise<boolean>;
188
+ showRewardedAd(adUnitId: string, placement?: string | null, customData?: string | null): void;
189
+ setRewardedAdExtraParameter(adUnitId: string, key: string, value: string | null): void;
190
+ setRewardedAdLocalExtraParameter(adUnitId: string, parameters: UnsafeObject): void;
191
+
192
+ // ─────────────────────────────────────────────────────────
193
+ // App Open Ads
194
+ // ─────────────────────────────────────────────────────────
195
+
196
+ loadAppOpenAd(adUnitId: string): void;
197
+ isAppOpenAdReady(adUnitId: string): Promise<boolean>;
198
+ showAppOpenAd(adUnitId: string, placement?: string | null, customData?: string | null): void;
199
+ setAppOpenAdExtraParameter(adUnitId: string, key: string, value: string | null): void;
200
+ setAppOpenAdLocalExtraParameter(adUnitId: string, parameters: UnsafeObject): void;
201
+
202
+ // ─────────────────────────────────────────────────────────
203
+ // Native UI Component AdView (Preload/Destroy)
204
+ // ─────────────────────────────────────────────────────────
205
+
206
+ preloadNativeUIComponentAdView(
207
+ adUnitId: string,
208
+ adFormat: string,
209
+ placement?: string | null,
210
+ customData?: string | null,
211
+ extraParameters?: UnsafeObject | null,
212
+ localExtraParameters?: UnsafeObject | null
213
+ ): Promise<AdViewId>;
214
+
215
+ destroyNativeUIComponentAdView(adViewId: number): Promise<void>;
216
+
217
+ // ─────────────────────────────────────────────────────────
218
+ // TurboModule Listener Management
219
+ // ─────────────────────────────────────────────────────────
220
+
221
+ addListener(eventType: string): void;
222
+ removeListeners(count: number): void;
223
+ }
224
+
225
+ /**
226
+ * Enforces use of the native AppLovinMAX TurboModule.
227
+ */
228
+ export default TurboModuleRegistry.getEnforcing<Spec>('AppLovinMAX');
@@ -1,15 +1,21 @@
1
1
  import type { AdInfo, AdLoadFailedInfo, AdDisplayFailedInfo, AdRewardInfo } from './AdInfo';
2
2
 
3
+ /**
4
+ * Represents any ad event object that can be emitted by the native AppLovin MAX module.
5
+ */
3
6
  export type AdEventObject = AdInfo | AdLoadFailedInfo | AdDisplayFailedInfo | AdRewardInfo;
4
7
 
5
8
  /**
6
- * Defines a generic event listener for the pragrammatic methods to receive an event from the native
7
- * module.
9
+ * A generic event listener for handling ad events in programmatic APIs.
10
+ *
11
+ * @template T - A specific ad event type.
8
12
  */
9
13
  export type AdEventListener<T extends AdEventObject> = (event: T) => void;
10
14
 
11
15
  /**
12
- * Defines a generic event object for the UI components i.e. AdView and NativeAdView to receive an
13
- * event from the native module.
16
+ * Wraps an ad event in a `nativeEvent` field, following the React Native synthetic event pattern.
17
+ * Used for UI component props such as {@link AdView} and {@link NativeAdView}.
18
+ *
19
+ * @template T - A specific ad event type.
14
20
  */
15
21
  export type AdNativeEvent<T extends AdEventObject> = { nativeEvent: T };