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
@@ -1,25 +1,32 @@
1
+ /**
2
+ * Provides methods to manage user privacy settings for AppLovin MAX.
3
+ */
1
4
  export type PrivacyType = {
2
5
  /**
3
- * Sets whether or not the user provided consent for information-sharing with AppLovin.
6
+ * Sets whether the user has granted consent for data collection and sharing.
4
7
  *
5
- * @param hasUserConsent true if the user provided consent for information sharing.
8
+ * @param hasUserConsent - `true` if the user has provided consent.
6
9
  */
7
10
  setHasUserConsent(hasUserConsent: boolean): void;
8
11
 
9
12
  /**
10
- * Checks if user set consent for information sharing.
13
+ * Checks whether the user has granted consent for information sharing.
14
+ *
15
+ * @returns A promise that resolves to `true` if the user has granted consent.
11
16
  */
12
17
  hasUserConsent(): Promise<boolean>;
13
18
 
14
19
  /**
15
- * Sets whether or not the user opted out of the sale of their personal information.
20
+ * Sets whether the user has opted out of the sale of their personal information.
16
21
  *
17
- * @param doNotSell true if the user opted out of the sale of their personal information.
22
+ * @param doNotSell - `true` if the user opted out of personal data sale.
18
23
  */
19
24
  setDoNotSell(doNotSell: boolean): void;
20
25
 
21
26
  /**
22
- * Checks if the user opted out of the sale of their personal information.
27
+ * Checks whether the user has opted out of the sale of their personal information.
28
+ *
29
+ * @returns A promise that resolves to `true` if the user has opted out.
23
30
  */
24
31
  isDoNotSell(): Promise<boolean>;
25
32
  };
@@ -2,18 +2,20 @@ import type { AdEventListener } from './AdEvent';
2
2
  import type { AdRewardInfo } from './AdInfo';
3
3
  import type { FullscreenAdType } from './FullscreenAd';
4
4
 
5
+ /**
6
+ * Defines the interface for managing rewarded ads.
7
+ * Extends {@link FullscreenAdType} with reward-specific callbacks.
8
+ */
5
9
  export type RewardedAdType = FullscreenAdType & {
6
10
  /**
7
- * Adds the specified event listener to receive {@link AdRewardInfo} when {@link RewardedAd}
8
- * rewards the user.
11
+ * Registers a listener for when a reward is granted to the user.
9
12
  *
10
- * @param listener Listener to be notified.
13
+ * @param listener - Callback to be notified with {@link AdRewardInfo}.
11
14
  */
12
15
  addAdReceivedRewardEventListener(listener: AdEventListener<AdRewardInfo>): void;
13
16
 
14
17
  /**
15
- * Removes the event listener to receive {@link AdRewardInfo} when {@link RewardedAd} rewards
16
- * the user.
18
+ * Unregisters the reward event listener.
17
19
  */
18
20
  removeAdReceivedRewardEventListener(): void;
19
21
  };
@@ -4,159 +4,155 @@ import type { LocalExtraParameterValue } from './AdProps';
4
4
  import type { AdViewPosition } from '../AdView';
5
5
 
6
6
  /**
7
- * Define a view-based ad (i.e. Banner / MREC)
7
+ * Defines the interface for view-based ads such as Banners and MRECs.
8
8
  */
9
9
  export type ViewAdType = {
10
10
  /**
11
- * Destroys the banner/MREC.
11
+ * Destroys the banner or MREC ad.
12
12
  *
13
- * @param adUnitId The ad unit ID of the ad to destroy.
13
+ * @param adUnitId - The ad unit ID of the ad to destroy.
14
14
  */
15
15
  destroyAd(adUnitId: string): void;
16
16
 
17
17
  /**
18
- * Shows the banner/MREC.
18
+ * Displays the banner or MREC ad.
19
19
  *
20
- * @param adUnitId The ad unit ID of the ad to show.
20
+ * @param adUnitId - The ad unit ID of the ad to show.
21
21
  */
22
22
  showAd(adUnitId: string): void;
23
23
 
24
24
  /**
25
- * Hides the banner/MREC.
25
+ * Hides the banner or MREC ad.
26
26
  *
27
- * @param adUnitId The ad unit ID of the ad to hide.
27
+ * @param adUnitId - The ad unit ID of the ad to hide.
28
28
  */
29
29
  hideAd(adUnitId: string): void;
30
30
 
31
31
  /**
32
- * Sets a placement to tie the showing ad’s events to.
32
+ * Sets a placement to associate with the showing ad’s events.
33
33
  *
34
- * @param adUnitId The ad unit ID of the ad to set a placement for.
35
- * @param placement The placement to tie the showing ad's events to.
34
+ * @param adUnitId - The ad unit ID.
35
+ * @param placement - The placement name.
36
36
  */
37
37
  setPlacement(adUnitId: string, placement: string | null): void;
38
38
 
39
39
  /**
40
- * Sets custom data to tie the showing ad’s events to.
40
+ * Sets custom data to associate with the showing ad’s events.
41
41
  *
42
- * @param adUnitId The ad unit ID of the ad to set custom data for.
43
- * @param customData The custom data to tie the showing ad's events to. Maximum size is 8KB.
42
+ * @param adUnitId - The ad unit ID.
43
+ * @param customData - Optional custom string (max 8 KB).
44
44
  */
45
45
  setCustomData(adUnitId: string, customData: string | null): void;
46
46
 
47
47
  /**
48
- * Updates the banner/mrec position.
48
+ * Updates the position of the banner or MREC.
49
49
  *
50
- * @param adUnitId The ad unit ID of the ad to update the position of.
51
- * @param bannerPosition {@link AdViewPosition} position.
50
+ * @param adUnitId - The ad unit ID.
51
+ * @param bannerPosition - The new position on screen.
52
52
  */
53
53
  updatePosition(adUnitId: string, bannerPosition: AdViewPosition): void;
54
54
 
55
55
  /**
56
- * Sets an extra key/value parameter for the ad.
56
+ * Sets an extra parameter for the ad.
57
57
  *
58
- * @param adUnitId The ad unit ID of the ad to set a parameter for.
59
- * @param key Key parameter.
60
- * @param value Value parameter.
58
+ * @param adUnitId - The ad unit ID.
59
+ * @param key - Parameter name.
60
+ * @param value - Parameter value (or `null` to clear it).
61
61
  */
62
62
  setExtraParameter(adUnitId: string, key: string, value: string | null): void;
63
63
 
64
64
  /**
65
- * Set a local extra parameter to pass to the adapter instances.
65
+ * Sets a local extra parameter to be passed to the mediation adapter.
66
66
  *
67
- * @param adUnitId The ad unit ID of the ad to set a local parameter for.
68
- * @param key Key parameter.
69
- * @param value Value parameter.
67
+ * @param adUnitId - The ad unit ID.
68
+ * @param key - Parameter name.
69
+ * @param value - Parameter value (string, number, boolean, object, or null).
70
70
  */
71
71
  setLocalExtraParameter(adUnitId: string, key: string, value: LocalExtraParameterValue): void;
72
72
 
73
73
  /**
74
- * Starts or resumes auto-refreshing of the banner/mrec.
74
+ * Starts or resumes auto-refresh for the ad.
75
75
  *
76
- * @param adUnitId The ad unit ID of the ad to start or resume auto-refreshing.
76
+ * @param adUnitId - The ad unit ID.
77
77
  */
78
78
  startAutoRefresh(adUnitId: string): void;
79
79
 
80
80
  /**
81
- * Pauses auto-refreshing of the banner/mrec.
81
+ * Pauses auto-refresh for the ad.
82
82
  *
83
- * @param adUnitId The ad unit ID of the ad to stop auto-refreshing.
83
+ * @param adUnitId - The ad unit ID.
84
84
  */
85
85
  stopAutoRefresh(adUnitId: string): void;
86
86
 
87
87
  /**
88
- * Adds the specified event listener to receive {@link AdInfo} when a view-base ad loads a new ad.
88
+ * Registers a listener for when a new ad is successfully loaded.
89
89
  *
90
- * @param listener Listener to be notified.
90
+ * @param listener - Callback to be notified with {@link AdInfo}.
91
91
  */
92
92
  addAdLoadedEventListener(listener: AdEventListener<AdInfo>): void;
93
93
 
94
94
  /**
95
- * Removes the event listener to receive {@link AdInfo} when a view-base ad loads a new ad.
95
+ * Unregisters the ad loaded listener.
96
96
  */
97
97
  removeAdLoadedEventListener(): void;
98
98
 
99
99
  /**
100
- * Adds the specified event listener to receive {@link AdLoadFailedInfo} when a view-base ad
101
- * could not load a new ad.
100
+ * Registers a listener for when ad loading fails.
102
101
  *
103
- * @param listener Listener to be notified.
102
+ * @param listener - Callback to be notified with {@link AdLoadFailedInfo}.
104
103
  */
105
104
  addAdLoadFailedEventListener(listener: AdEventListener<AdLoadFailedInfo>): void;
106
105
 
107
106
  /**
108
- * Removes the event listener to receive {@link AdLoadFailedInfo} when a view-base ad could not
109
- * load a new ad.
107
+ * Unregisters the ad load failure listener.
110
108
  */
111
109
  removeAdLoadFailedEventListener(): void;
112
110
 
113
111
  /**
114
- * Adds the specified event listener to receive {@link AdInfo} when the user clicks the ad.
112
+ * Registers a listener for ad click events.
115
113
  *
116
- * @param listener Listener to be notified.
114
+ * @param listener - Callback to be notified with {@link AdInfo}.
117
115
  */
118
116
  addAdClickedEventListener(listener: AdEventListener<AdInfo>): void;
119
117
 
120
118
  /**
121
- * Removes the event listener to receive {@link AdInfo} when the user clicks the ad.
119
+ * Unregisters the ad click listener.
122
120
  */
123
121
  removeAdClickedEventListener(): void;
124
122
 
125
123
  /**
126
- * Adds the specified event listener to receive {@link AdInfo} when a view-base ad collapses the ad.
124
+ * Registers a listener for when the ad collapses (e.g. after expansion).
127
125
  *
128
- * @param listener Listener to be notified.
126
+ * @param listener - Callback to be notified with {@link AdInfo}.
129
127
  */
130
128
  addAdCollapsedEventListener(listener: AdEventListener<AdInfo>): void;
131
129
 
132
130
  /**
133
- * Removes the event listener to receive {@link AdInfo} when a view-base ad collapses the ad.
131
+ * Unregisters the ad collapsed listener.
134
132
  */
135
133
  removeAdCollapsedEventListener(): void;
136
134
 
137
135
  /**
138
- * Adds the specified event listener to receive {@link AdInfo} when a view-base ad expands the ad.
136
+ * Registers a listener for when the ad expands.
139
137
  *
140
- * @param listener Listener to be notified.
138
+ * @param listener - Callback to be notified with {@link AdInfo}.
141
139
  */
142
140
  addAdExpandedEventListener(listener: AdEventListener<AdInfo>): void;
143
141
 
144
142
  /**
145
- * Removes the event listener to receive {@link AdInfo} when a view-base ad expands the ad.
143
+ * Unregisters the ad expanded listener.
146
144
  */
147
145
  removeAdExpandedEventListener(): void;
148
146
 
149
147
  /**
150
- * Adds the specified event listener to receive {@link AdInfo} when a view-base ad pays
151
- * ad revenue to the publisher.
148
+ * Registers a listener for when the ad pays revenue to the publisher.
152
149
  *
153
- * @param listener Listener to be notified.
150
+ * @param listener - Callback to be notified with {@link AdInfo}.
154
151
  */
155
152
  addAdRevenuePaidListener(listener: AdEventListener<AdInfo>): void;
156
153
 
157
154
  /**
158
- * Removes the event listener to receive {@link AdInfo} when when a view-base ad pays ad
159
- * revenue to the publisher.
155
+ * Unregisters the ad revenue paid listener.
160
156
  */
161
157
  removeAdRevenuePaidListener(): void;
162
158
  };