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.
- package/android/build.gradle +3 -3
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdView.java +4 -10
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXAdViewUiComponent.java +17 -8
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXModuleImpl.java +36 -14
- package/android/src/newarch/com/applovin/reactnative/AppLovinMAXModule.java +6 -6
- package/android/src/oldarch/com/applovin/reactnative/AppLovinMAXModule.java +6 -6
- package/ios/AppLovinMAX.mm +36 -13
- package/ios/AppLovinMAXAdView.h +1 -0
- package/ios/AppLovinMAXAdView.mm +3 -9
- package/ios/AppLovinMAXAdViewUIComponent.h +1 -2
- package/ios/AppLovinMAXAdViewUIComponent.mm +18 -10
- package/lib/commonjs/AdView.js +63 -79
- package/lib/commonjs/AdView.js.map +1 -1
- package/lib/commonjs/AppLovinMAX.js +43 -29
- package/lib/commonjs/AppLovinMAX.js.map +1 -1
- package/lib/commonjs/BannerAd.js +2 -3
- package/lib/commonjs/BannerAd.js.map +1 -1
- package/lib/commonjs/ErrorCode.js +24 -31
- package/lib/commonjs/ErrorCode.js.map +1 -1
- package/lib/commonjs/EventEmitter.js +22 -1
- package/lib/commonjs/EventEmitter.js.map +1 -1
- package/lib/commonjs/Utils.js +22 -4
- package/lib/commonjs/Utils.js.map +1 -1
- package/lib/commonjs/index.js +1 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdView.js +34 -24
- package/lib/commonjs/nativeAd/NativeAdView.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdViewComponents.js +85 -43
- package/lib/commonjs/nativeAd/NativeAdViewComponents.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdViewProvider.js +30 -2
- package/lib/commonjs/nativeAd/NativeAdViewProvider.js.map +1 -1
- package/lib/commonjs/specs/AppLovinMAXAdViewNativeComponent.js +27 -0
- package/lib/commonjs/specs/AppLovinMAXAdViewNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/AppLovinMAXNativeAdViewNativeComponent.js +23 -0
- package/lib/commonjs/specs/AppLovinMAXNativeAdViewNativeComponent.js.map +1 -1
- package/lib/commonjs/specs/NativeAppLovinMAXModule.js +7 -0
- package/lib/commonjs/specs/NativeAppLovinMAXModule.js.map +1 -1
- package/lib/commonjs/types/AdInfo.js +13 -16
- package/lib/commonjs/types/AdInfo.js.map +1 -1
- package/lib/module/AdView.js +62 -77
- package/lib/module/AdView.js.map +1 -1
- package/lib/module/AppLovinMAX.js +44 -29
- package/lib/module/AppLovinMAX.js.map +1 -1
- package/lib/module/BannerAd.js +2 -3
- package/lib/module/BannerAd.js.map +1 -1
- package/lib/module/ErrorCode.js +24 -31
- package/lib/module/ErrorCode.js.map +1 -1
- package/lib/module/EventEmitter.js +22 -1
- package/lib/module/EventEmitter.js.map +1 -1
- package/lib/module/Utils.js +22 -4
- package/lib/module/Utils.js.map +1 -1
- package/lib/module/nativeAd/NativeAdView.js +34 -21
- package/lib/module/nativeAd/NativeAdView.js.map +1 -1
- package/lib/module/nativeAd/NativeAdViewComponents.js +87 -40
- package/lib/module/nativeAd/NativeAdViewComponents.js.map +1 -1
- package/lib/module/nativeAd/NativeAdViewProvider.js +30 -0
- package/lib/module/nativeAd/NativeAdViewProvider.js.map +1 -1
- package/lib/module/specs/AppLovinMAXAdViewNativeComponent.js +28 -0
- package/lib/module/specs/AppLovinMAXAdViewNativeComponent.js.map +1 -1
- package/lib/module/specs/AppLovinMAXNativeAdViewNativeComponent.js +24 -0
- package/lib/module/specs/AppLovinMAXNativeAdViewNativeComponent.js.map +1 -1
- package/lib/module/specs/NativeAppLovinMAXModule.js +9 -0
- package/lib/module/specs/NativeAppLovinMAXModule.js.map +1 -1
- package/lib/module/types/AdInfo.js +13 -16
- package/lib/module/types/AdInfo.js.map +1 -1
- package/lib/typescript/src/AdView.d.ts +27 -21
- package/lib/typescript/src/AdView.d.ts.map +1 -1
- package/lib/typescript/src/AppLovinMAX.d.ts +22 -21
- package/lib/typescript/src/AppLovinMAX.d.ts.map +1 -1
- package/lib/typescript/src/BannerAd.d.ts.map +1 -1
- package/lib/typescript/src/ErrorCode.d.ts +24 -31
- package/lib/typescript/src/ErrorCode.d.ts.map +1 -1
- package/lib/typescript/src/EventEmitter.d.ts +16 -0
- package/lib/typescript/src/EventEmitter.d.ts.map +1 -1
- package/lib/typescript/src/Utils.d.ts +15 -0
- package/lib/typescript/src/Utils.d.ts.map +1 -1
- package/lib/typescript/src/nativeAd/NativeAdView.d.ts +15 -7
- package/lib/typescript/src/nativeAd/NativeAdView.d.ts.map +1 -1
- package/lib/typescript/src/nativeAd/NativeAdViewComponents.d.ts +65 -1
- package/lib/typescript/src/nativeAd/NativeAdViewComponents.d.ts.map +1 -1
- package/lib/typescript/src/nativeAd/NativeAdViewProvider.d.ts +17 -0
- package/lib/typescript/src/nativeAd/NativeAdViewProvider.d.ts.map +1 -1
- package/lib/typescript/src/specs/AppLovinMAXAdViewNativeComponent.d.ts +45 -1
- package/lib/typescript/src/specs/AppLovinMAXAdViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/specs/AppLovinMAXNativeAdViewNativeComponent.d.ts +57 -6
- package/lib/typescript/src/specs/AppLovinMAXNativeAdViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeAppLovinMAXModule.d.ts +13 -3
- package/lib/typescript/src/specs/NativeAppLovinMAXModule.d.ts.map +1 -1
- package/lib/typescript/src/types/AdEvent.d.ts +10 -4
- package/lib/typescript/src/types/AdEvent.d.ts.map +1 -1
- package/lib/typescript/src/types/AdInfo.d.ts +78 -85
- package/lib/typescript/src/types/AdInfo.d.ts.map +1 -1
- package/lib/typescript/src/types/AdProps.d.ts +14 -15
- package/lib/typescript/src/types/AdProps.d.ts.map +1 -1
- package/lib/typescript/src/types/AdViewProps.d.ts +32 -29
- package/lib/typescript/src/types/AdViewProps.d.ts.map +1 -1
- package/lib/typescript/src/types/AppLovinMAX.d.ts +50 -53
- package/lib/typescript/src/types/AppLovinMAX.d.ts.map +1 -1
- package/lib/typescript/src/types/BannerAd.d.ts +24 -18
- package/lib/typescript/src/types/BannerAd.d.ts.map +1 -1
- package/lib/typescript/src/types/CMPError.d.ts +7 -4
- package/lib/typescript/src/types/CMPError.d.ts.map +1 -1
- package/lib/typescript/src/types/Configuration.d.ts +12 -14
- package/lib/typescript/src/types/Configuration.d.ts.map +1 -1
- package/lib/typescript/src/types/FullscreenAd.d.ts +39 -46
- package/lib/typescript/src/types/FullscreenAd.d.ts.map +1 -1
- package/lib/typescript/src/types/MRecAd.d.ts +7 -3
- package/lib/typescript/src/types/MRecAd.d.ts.map +1 -1
- package/lib/typescript/src/types/NativeAd.d.ts +12 -11
- package/lib/typescript/src/types/NativeAd.d.ts.map +1 -1
- package/lib/typescript/src/types/NativeAdViewProps.d.ts +4 -3
- package/lib/typescript/src/types/NativeAdViewProps.d.ts.map +1 -1
- package/lib/typescript/src/types/Privacy.d.ts +13 -6
- package/lib/typescript/src/types/Privacy.d.ts.map +1 -1
- package/lib/typescript/src/types/RewardedAd.d.ts +7 -5
- package/lib/typescript/src/types/RewardedAd.d.ts.map +1 -1
- package/lib/typescript/src/types/ViewAd.d.ts +46 -50
- package/lib/typescript/src/types/ViewAd.d.ts.map +1 -1
- package/package.json +1 -1
- package/react-native-applovin-max.podspec +2 -2
- package/src/AdView.tsx +64 -82
- package/src/AppLovinMAX.ts +39 -29
- package/src/BannerAd.ts +2 -3
- package/src/ErrorCode.ts +24 -31
- package/src/EventEmitter.ts +20 -2
- package/src/Utils.ts +20 -1
- package/src/nativeAd/NativeAdView.tsx +31 -21
- package/src/nativeAd/NativeAdViewComponents.tsx +97 -38
- package/src/nativeAd/NativeAdViewProvider.tsx +23 -0
- package/src/specs/AppLovinMAXAdViewNativeComponent.ts +62 -1
- package/src/specs/AppLovinMAXNativeAdViewNativeComponent.ts +70 -6
- package/src/specs/NativeAppLovinMAXModule.ts +77 -56
- package/src/types/AdEvent.ts +10 -4
- package/src/types/AdInfo.ts +78 -85
- package/src/types/AdProps.ts +14 -15
- package/src/types/AdViewProps.ts +33 -29
- package/src/types/AppLovinMAX.ts +50 -53
- package/src/types/BannerAd.ts +24 -18
- package/src/types/CMPError.ts +7 -4
- package/src/types/Configuration.ts +12 -14
- package/src/types/FullscreenAd.ts +39 -46
- package/src/types/MRecAd.ts +7 -3
- package/src/types/NativeAd.ts +12 -11
- package/src/types/NativeAdViewProps.ts +4 -3
- package/src/types/Privacy.ts +13 -6
- package/src/types/RewardedAd.ts +7 -5
- package/src/types/ViewAd.ts +46 -50
package/src/types/AdInfo.ts
CHANGED
|
@@ -2,85 +2,83 @@ import type { ErrorCode } from '../ErrorCode';
|
|
|
2
2
|
import type { AdViewId } from './AdViewProps';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Represents
|
|
5
|
+
* Represents a successfully loaded ad served by AppLovin MAX.
|
|
6
6
|
*/
|
|
7
7
|
export type AdInfo = {
|
|
8
8
|
/**
|
|
9
|
-
* The ad unit ID
|
|
9
|
+
* The ad unit ID that was used to load this ad.
|
|
10
10
|
*/
|
|
11
11
|
adUnitId: string;
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* The format of
|
|
14
|
+
* The format of the ad.
|
|
15
15
|
*/
|
|
16
16
|
adFormat: string;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* The unique
|
|
19
|
+
* The unique identifier of the associated native AdView component, if any.
|
|
20
20
|
*/
|
|
21
21
|
adViewId?: AdViewId;
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* The creative ID
|
|
25
|
-
*
|
|
24
|
+
* The creative ID associated with the ad.
|
|
25
|
+
* This can be used to report issues with the creative.
|
|
26
26
|
*
|
|
27
|
-
* @see
|
|
27
|
+
* @see https://support.applovin.com/hc/en-us/articles/13986039797389
|
|
28
28
|
*/
|
|
29
29
|
creativeId?: string | null;
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
* The ad network
|
|
33
|
-
*
|
|
34
|
-
* @see {@link https://support.applovin.com/hc/en-us/articles/13986039797389-Creative-Debugger#h_01HC10588YWTJHYE1E35HWQTX7}
|
|
32
|
+
* The name of the ad network that served the ad.
|
|
35
33
|
*/
|
|
36
34
|
networkName: string;
|
|
37
35
|
|
|
38
36
|
/**
|
|
39
|
-
* The
|
|
37
|
+
* The name of the placement as configured on the ad network side.
|
|
40
38
|
*/
|
|
41
39
|
networkPlacement: string;
|
|
42
40
|
|
|
43
41
|
/**
|
|
44
|
-
* The placement name
|
|
45
|
-
*
|
|
42
|
+
* The custom placement name defined in your integration.
|
|
43
|
+
* Used for postback reporting.
|
|
46
44
|
*/
|
|
47
45
|
placement?: string | null;
|
|
48
46
|
|
|
49
47
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
48
|
+
* The revenue generated from the ad impression, in USD.
|
|
49
|
+
* Defaults to 0 if not available.
|
|
52
50
|
*/
|
|
53
51
|
revenue: number;
|
|
54
52
|
|
|
55
53
|
/**
|
|
56
|
-
* The precision of the revenue value for this ad.
|
|
54
|
+
* The precision level of the revenue value reported for this ad.
|
|
57
55
|
*
|
|
58
|
-
* Possible values
|
|
59
|
-
* - "
|
|
60
|
-
* - "
|
|
61
|
-
* - "
|
|
62
|
-
* - "undefined"
|
|
63
|
-
* - ""
|
|
56
|
+
* Possible values:
|
|
57
|
+
* - `"exact"` — Revenue from a real-time auction.
|
|
58
|
+
* - `"estimated"` — Revenue estimated via auto-CPM.
|
|
59
|
+
* - `"publisher_defined"` — Revenue set manually by the publisher.
|
|
60
|
+
* - `"undefined"` — The ad network does not permit impression-level revenue data.
|
|
61
|
+
* - `""` — Empty when revenue and precision are unavailable (e.g., in test mode).
|
|
64
62
|
*/
|
|
65
63
|
revenuePrecision: string;
|
|
66
64
|
|
|
67
65
|
/**
|
|
68
|
-
* The
|
|
66
|
+
* The name of the DSP (Demand-Side Platform), if served through AppLovin Exchange.
|
|
69
67
|
*/
|
|
70
68
|
dspName?: string | null;
|
|
71
69
|
|
|
72
70
|
/**
|
|
73
|
-
*
|
|
71
|
+
* Total mediation load time in milliseconds.
|
|
74
72
|
*/
|
|
75
73
|
latencyMillis: number;
|
|
76
74
|
|
|
77
75
|
/**
|
|
78
|
-
* The
|
|
76
|
+
* The full ad waterfall associated with this ad request.
|
|
79
77
|
*/
|
|
80
78
|
waterfall?: AdWaterfallInfo;
|
|
81
79
|
|
|
82
80
|
/**
|
|
83
|
-
* The native ad
|
|
81
|
+
* The native ad, if available.
|
|
84
82
|
*/
|
|
85
83
|
nativeAd?: AdNativeInfo | null;
|
|
86
84
|
|
|
@@ -94,264 +92,259 @@ export type AdInfo = {
|
|
|
94
92
|
};
|
|
95
93
|
|
|
96
94
|
/**
|
|
97
|
-
*
|
|
95
|
+
* Represents a failure when attempting to load an ad.
|
|
98
96
|
*/
|
|
99
97
|
export type AdLoadFailedInfo = {
|
|
100
98
|
/**
|
|
101
|
-
* The ad unit ID for which
|
|
99
|
+
* The ad unit ID for which the load failed.
|
|
102
100
|
*/
|
|
103
101
|
adUnitId: string;
|
|
104
102
|
|
|
105
103
|
/**
|
|
106
|
-
* The
|
|
104
|
+
* The native AdView component ID, if available.
|
|
107
105
|
*/
|
|
108
106
|
adViewId?: AdViewId;
|
|
109
107
|
|
|
110
108
|
/**
|
|
111
|
-
*
|
|
109
|
+
* AppLovin MAX-defined error code.
|
|
112
110
|
*/
|
|
113
111
|
code: ErrorCode;
|
|
114
112
|
|
|
115
113
|
/**
|
|
116
|
-
*
|
|
114
|
+
* Descriptive message for the error.
|
|
117
115
|
*/
|
|
118
116
|
message?: string | null;
|
|
119
117
|
|
|
120
118
|
/**
|
|
121
|
-
*
|
|
119
|
+
* Error code from the mediated network.
|
|
122
120
|
*/
|
|
123
121
|
mediatedNetworkErrorCode: number;
|
|
124
122
|
|
|
125
123
|
/**
|
|
126
|
-
*
|
|
124
|
+
* Error message from the mediated network.
|
|
127
125
|
*/
|
|
128
126
|
mediatedNetworkErrorMessage: string;
|
|
129
127
|
|
|
130
128
|
/**
|
|
131
|
-
*
|
|
129
|
+
* Additional debug information for ad load failure (legacy).
|
|
132
130
|
*/
|
|
133
131
|
adLoadFailureInfo?: string | null;
|
|
134
132
|
|
|
135
133
|
/**
|
|
136
|
-
*
|
|
134
|
+
* Waterfall data associated with the failed request.
|
|
137
135
|
*/
|
|
138
136
|
waterfall?: AdWaterfallInfo | null;
|
|
139
137
|
};
|
|
140
138
|
|
|
141
139
|
/**
|
|
142
|
-
*
|
|
140
|
+
* Represents an error that occurred when displaying an ad.
|
|
143
141
|
*/
|
|
144
142
|
export type AdDisplayFailedInfo = AdInfo & {
|
|
145
143
|
/**
|
|
146
|
-
*
|
|
144
|
+
* AppLovin MAX-defined error code.
|
|
147
145
|
*/
|
|
148
146
|
code: ErrorCode;
|
|
149
147
|
|
|
150
148
|
/**
|
|
151
|
-
*
|
|
149
|
+
* Descriptive message for the error.
|
|
152
150
|
*/
|
|
153
151
|
message?: string | null;
|
|
154
152
|
|
|
155
153
|
/**
|
|
156
|
-
*
|
|
154
|
+
* Error code from the mediated network.
|
|
157
155
|
*/
|
|
158
156
|
mediatedNetworkErrorCode: number;
|
|
159
157
|
|
|
160
158
|
/**
|
|
161
|
-
*
|
|
159
|
+
* Error message from the mediated network.
|
|
162
160
|
*/
|
|
163
161
|
mediatedNetworkErrorMessage: string;
|
|
164
162
|
};
|
|
165
163
|
|
|
166
164
|
/**
|
|
167
|
-
* Represents a reward
|
|
165
|
+
* Represents a successful reward event from a rewarded ad.
|
|
168
166
|
*/
|
|
169
167
|
export type AdRewardInfo = AdInfo & {
|
|
170
168
|
/**
|
|
171
|
-
* The reward
|
|
169
|
+
* The label of the reward.
|
|
172
170
|
*/
|
|
173
171
|
rewardLabel?: string | null;
|
|
174
172
|
|
|
175
173
|
/**
|
|
176
|
-
* The
|
|
174
|
+
* The reward amount, as a string.
|
|
177
175
|
*/
|
|
178
176
|
rewardAmount: string;
|
|
179
177
|
};
|
|
180
178
|
|
|
181
179
|
/**
|
|
182
|
-
*
|
|
180
|
+
* Describes metadata for a native ad, including asset availability.
|
|
183
181
|
*/
|
|
184
182
|
export type AdNativeInfo = {
|
|
185
183
|
/**
|
|
186
|
-
*
|
|
184
|
+
* Title text of the native ad for use in {@link TitleView}.
|
|
187
185
|
*/
|
|
188
186
|
title?: string;
|
|
189
187
|
|
|
190
188
|
/**
|
|
191
|
-
*
|
|
189
|
+
* Advertiser name for {@link AdvertiserView}.
|
|
192
190
|
*/
|
|
193
191
|
advertiser?: string;
|
|
194
192
|
|
|
195
193
|
/**
|
|
196
|
-
*
|
|
194
|
+
* Body text for {@link BodyView}.
|
|
197
195
|
*/
|
|
198
196
|
body?: string;
|
|
199
197
|
|
|
200
198
|
/**
|
|
201
|
-
*
|
|
199
|
+
* Call-to-action label for {@link CallToActionView}.
|
|
202
200
|
*/
|
|
203
201
|
callToAction?: string;
|
|
204
202
|
|
|
205
203
|
/**
|
|
206
|
-
*
|
|
204
|
+
* Star rating (0.0 to 5.0) for {@link StarRatingView}.
|
|
207
205
|
*/
|
|
208
206
|
starRating?: number;
|
|
209
207
|
|
|
210
208
|
/**
|
|
211
|
-
*
|
|
209
|
+
* Aspect ratio (width / height) for {@link MediaView}, if available.
|
|
212
210
|
*/
|
|
213
211
|
mediaContentAspectRatio?: number;
|
|
214
212
|
|
|
215
213
|
/**
|
|
216
|
-
* Whether
|
|
214
|
+
* Whether an icon image is available for {@link IconView}.
|
|
217
215
|
*/
|
|
218
216
|
isIconImageAvailable: boolean;
|
|
219
217
|
|
|
220
218
|
/**
|
|
221
|
-
* Whether
|
|
219
|
+
* Whether the options menu view is available for {@link OptionsView}.
|
|
222
220
|
*/
|
|
223
221
|
isOptionsViewAvailable: boolean;
|
|
224
222
|
|
|
225
223
|
/**
|
|
226
|
-
* Whether
|
|
224
|
+
* Whether a media view is available for {@link MediaView}.
|
|
227
225
|
*/
|
|
228
226
|
isMediaViewAvailable: boolean;
|
|
229
227
|
};
|
|
230
228
|
|
|
231
229
|
/**
|
|
232
|
-
*
|
|
233
|
-
* responses, etc.
|
|
230
|
+
* Contains metadata about the ad waterfall evaluated during an ad request.
|
|
234
231
|
*/
|
|
235
232
|
export type AdWaterfallInfo = {
|
|
236
233
|
/**
|
|
237
|
-
* The
|
|
234
|
+
* The waterfall name for this request.
|
|
238
235
|
*/
|
|
239
236
|
name: string;
|
|
240
237
|
|
|
241
238
|
/**
|
|
242
|
-
* The
|
|
239
|
+
* The test name, if the waterfall is part of an A/B test.
|
|
243
240
|
*/
|
|
244
241
|
testName: string;
|
|
245
242
|
|
|
246
243
|
/**
|
|
247
|
-
*
|
|
248
|
-
* ordered by their position.
|
|
244
|
+
* Ordered list of network responses attempted during mediation.
|
|
249
245
|
*/
|
|
250
246
|
networkResponses: AdNetworkResponseInfo[];
|
|
251
247
|
|
|
252
248
|
/**
|
|
253
|
-
*
|
|
249
|
+
* Total time taken to complete the waterfall, in milliseconds.
|
|
254
250
|
*/
|
|
255
251
|
latencyMillis: number;
|
|
256
252
|
};
|
|
257
253
|
|
|
258
254
|
/**
|
|
259
|
-
*
|
|
260
|
-
* Each adapter response {@link AdNetworkResponseInfo} corresponds to one of these states.
|
|
255
|
+
* Enumeration of possible ad load states for each network in the waterfall.
|
|
261
256
|
*/
|
|
262
257
|
export enum AdLoadState {
|
|
263
258
|
/**
|
|
264
|
-
*
|
|
265
|
-
* an ad higher in the waterfall loaded successfully.
|
|
259
|
+
* SDK did not attempt to load an ad from this network.
|
|
266
260
|
*/
|
|
267
261
|
LoadStateAdLoadNotAttempted = 0,
|
|
268
262
|
|
|
269
263
|
/**
|
|
270
|
-
* An ad successfully loaded from this network.
|
|
264
|
+
* An ad was successfully loaded from this network.
|
|
271
265
|
*/
|
|
272
266
|
LoadStateAdLoaded = 1,
|
|
273
267
|
|
|
274
268
|
/**
|
|
275
|
-
*
|
|
269
|
+
* The network failed to load an ad.
|
|
276
270
|
*/
|
|
277
271
|
LoadStateAdFailedToLoad = 2,
|
|
278
272
|
}
|
|
279
273
|
|
|
280
274
|
/**
|
|
281
|
-
*
|
|
275
|
+
* General error info object used in waterfall response details.
|
|
282
276
|
*/
|
|
283
277
|
export type AdErrorInfo = {
|
|
284
278
|
/**
|
|
285
|
-
*
|
|
279
|
+
* AppLovin MAX-defined error code.
|
|
286
280
|
*/
|
|
287
281
|
code: ErrorCode;
|
|
288
282
|
|
|
289
283
|
/**
|
|
290
|
-
*
|
|
284
|
+
* Descriptive error message.
|
|
291
285
|
*/
|
|
292
286
|
message?: string;
|
|
293
287
|
|
|
294
288
|
/**
|
|
295
|
-
* @deprecated
|
|
289
|
+
* @deprecated Use `message` instead.
|
|
296
290
|
*/
|
|
297
291
|
adLoadFailureInfo?: string;
|
|
298
292
|
};
|
|
299
293
|
|
|
300
294
|
/**
|
|
301
|
-
*
|
|
295
|
+
* Contains information about a single mediated network response.
|
|
302
296
|
*/
|
|
303
297
|
export type AdNetworkResponseInfo = {
|
|
304
298
|
/**
|
|
305
|
-
* The
|
|
299
|
+
* The result of the load attempt.
|
|
306
300
|
*/
|
|
307
301
|
adLoadState: AdLoadState;
|
|
308
302
|
|
|
309
303
|
/**
|
|
310
|
-
*
|
|
304
|
+
* Metadata about the mediated network.
|
|
311
305
|
*/
|
|
312
306
|
mediatedNetwork?: AdMediatedNetworkInfo;
|
|
313
307
|
|
|
314
308
|
/**
|
|
315
|
-
*
|
|
309
|
+
* A key-value map of adapter-specific credentials, as configured in the MAX dashboard.
|
|
316
310
|
*/
|
|
317
311
|
credentials: { [key: string]: string | number | boolean | object | null };
|
|
318
312
|
|
|
319
313
|
/**
|
|
320
|
-
* The ad load error this network response
|
|
321
|
-
*
|
|
322
|
-
* is NOT LoadStateAdFailedToLoad).
|
|
314
|
+
* The ad load error resulting from this network response. This will be unavailable if no ad load
|
|
315
|
+
* attempt was made or if the ad loaded successfully (i.e., [adLoadState] is NOT [LoadStateAdFailedToLoad]).
|
|
323
316
|
*/
|
|
324
317
|
error?: AdErrorInfo;
|
|
325
318
|
|
|
326
319
|
/**
|
|
327
|
-
* The amount of time the network took to load
|
|
328
|
-
* If
|
|
329
|
-
*
|
|
320
|
+
* The amount of time, in milliseconds, the network took to load an ad—regardless of success.
|
|
321
|
+
* If no ad load attempt was made (i.e., [adLoadState] is [LoadStateAdLoadNotAttempted]),
|
|
322
|
+
* this value will be -1.
|
|
330
323
|
*/
|
|
331
324
|
latencyMillis: number;
|
|
332
325
|
};
|
|
333
326
|
|
|
334
327
|
/**
|
|
335
|
-
*
|
|
328
|
+
* Metadata about a mediated ad network.
|
|
336
329
|
*/
|
|
337
330
|
export type AdMediatedNetworkInfo = {
|
|
338
331
|
/**
|
|
339
|
-
*
|
|
332
|
+
* Name of the mediated network.
|
|
340
333
|
*/
|
|
341
334
|
name: string;
|
|
342
335
|
|
|
343
336
|
/**
|
|
344
|
-
*
|
|
337
|
+
* Fully-qualified adapter class name.
|
|
345
338
|
*/
|
|
346
339
|
adapterClassName: string;
|
|
347
340
|
|
|
348
341
|
/**
|
|
349
|
-
*
|
|
342
|
+
* Version of the adapter.
|
|
350
343
|
*/
|
|
351
344
|
adapterVersion: string;
|
|
352
345
|
|
|
353
346
|
/**
|
|
354
|
-
*
|
|
347
|
+
* Version of the mediated network’s SDK.
|
|
355
348
|
*/
|
|
356
349
|
sdkVersion: string;
|
|
357
350
|
};
|
package/src/types/AdProps.ts
CHANGED
|
@@ -1,64 +1,63 @@
|
|
|
1
1
|
import type { AdDisplayFailedInfo, AdInfo, AdLoadFailedInfo } from './AdInfo';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Represents the allowed value types for local extra parameters passed to the ad adapter.
|
|
5
|
+
* Can be a primitive, object, or null.
|
|
5
6
|
*/
|
|
6
7
|
export type LocalExtraParameterValue = string | number | boolean | object | null;
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
|
-
* Defines the base
|
|
10
|
+
* Defines the base props shared by ad UI components like {@link AdView} and {@link NativeAdView}.
|
|
10
11
|
*/
|
|
11
12
|
export type AdProps = {
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
+
* The ad unit ID used to load ads.
|
|
14
15
|
*/
|
|
15
16
|
adUnitId: string;
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
|
-
*
|
|
19
|
-
* format, for granular reporting in ad events.
|
|
19
|
+
* The placement name defined in your integration, used for granular reporting.
|
|
20
20
|
*/
|
|
21
21
|
placement?: string | null;
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Optional custom data to attach to the ad, used for analytics or targeting.
|
|
25
25
|
*/
|
|
26
26
|
customData?: string | null;
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
30
|
-
* for the ad.
|
|
29
|
+
* Extra parameters to be sent as key-value string pairs.
|
|
31
30
|
*/
|
|
32
31
|
extraParameters?: { [key: string]: string };
|
|
33
32
|
|
|
34
33
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
34
|
+
* Local extra parameters sent to the adapter instance.
|
|
35
|
+
* Supports string and boolean values only.
|
|
37
36
|
*/
|
|
38
37
|
localExtraParameters?: { [key: string]: string | boolean };
|
|
39
38
|
|
|
40
39
|
/**
|
|
41
|
-
*
|
|
40
|
+
* Called when a new ad is successfully loaded.
|
|
42
41
|
*/
|
|
43
42
|
onAdLoaded?: (adInfo: AdInfo) => void;
|
|
44
43
|
|
|
45
44
|
/**
|
|
46
|
-
*
|
|
45
|
+
* Called when the SDK fails to load a new ad.
|
|
47
46
|
*/
|
|
48
47
|
onAdLoadFailed?: (error: AdLoadFailedInfo) => void;
|
|
49
48
|
|
|
50
49
|
/**
|
|
51
|
-
*
|
|
50
|
+
* Called when the ad fails to display after being loaded.
|
|
52
51
|
*/
|
|
53
52
|
onAdDisplayFailed?: (error: AdDisplayFailedInfo) => void;
|
|
54
53
|
|
|
55
54
|
/**
|
|
56
|
-
*
|
|
55
|
+
* Called when the ad is clicked by the user.
|
|
57
56
|
*/
|
|
58
57
|
onAdClicked?: (adInfo: AdInfo) => void;
|
|
59
58
|
|
|
60
59
|
/**
|
|
61
|
-
*
|
|
60
|
+
* Called when ad revenue is paid to the publisher.
|
|
62
61
|
*/
|
|
63
62
|
onAdRevenuePaid?: (adInfo: AdInfo) => void;
|
|
64
63
|
};
|
package/src/types/AdViewProps.ts
CHANGED
|
@@ -3,95 +3,99 @@ import type { AdInfo } from './AdInfo';
|
|
|
3
3
|
import type { AdFormat } from '../AdView';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* A
|
|
6
|
+
* A reference to the {@link AdView} instance, allowing imperative control.
|
|
7
7
|
*/
|
|
8
8
|
export type AdViewHandler = {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Triggers a manual ad load starting.
|
|
11
|
+
* This is only needed if {@link loadOnMount} is set to `false`.
|
|
11
12
|
*/
|
|
12
13
|
loadAd(): void;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
|
-
* A unique identifier for referencing a specific AdView instance.
|
|
17
|
+
* A unique identifier for referencing a specific {@link AdView} instance.
|
|
17
18
|
*
|
|
18
|
-
* -
|
|
19
|
-
* -
|
|
19
|
+
* - A number represents the ID of a preloaded or managed AdView.
|
|
20
|
+
* - `undefined` means the AdView is not preloaded or assigned an ID.
|
|
20
21
|
*/
|
|
21
22
|
export type AdViewId = number | undefined;
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
|
-
*
|
|
25
|
+
* Props used to configure and render an {@link AdView} (i.e. Banner or MREC).
|
|
25
26
|
*/
|
|
26
27
|
export type AdViewProps = AdProps & {
|
|
27
28
|
/**
|
|
28
|
-
*
|
|
29
|
-
* {@link AdFormat.BANNER} or {@link AdFormat.MREC}.
|
|
29
|
+
* The ad format to load for this view.
|
|
30
|
+
* Must be {@link AdFormat.BANNER} or {@link AdFormat.MREC}.
|
|
30
31
|
*/
|
|
31
32
|
adFormat: AdFormat;
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
|
-
* A unique identifier
|
|
35
|
-
* Used
|
|
35
|
+
* A unique identifier for the AdView instance.
|
|
36
|
+
* Used for tracking and preloading specific ad views.
|
|
36
37
|
*/
|
|
37
38
|
adViewId?: AdViewId;
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
|
-
*
|
|
41
|
+
* Enables adaptive banner sizing if `true`.
|
|
42
|
+
* Ignored for MREC ads.
|
|
41
43
|
*/
|
|
42
44
|
adaptiveBannerEnabled?: boolean;
|
|
43
45
|
|
|
44
46
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
+
* Enables or disables automatic ad refresh.
|
|
48
|
+
* Defaults to `true`.
|
|
47
49
|
*/
|
|
48
50
|
autoRefresh?: boolean;
|
|
49
51
|
|
|
50
52
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
+
* If `true`, the ad will be loaded automatically when the component mounts.
|
|
54
|
+
* Set to `false` for ads to be loaded manually using the ref after the component mounts.
|
|
55
|
+
*
|
|
56
|
+
* @default true
|
|
53
57
|
*/
|
|
54
58
|
loadOnMount?: boolean;
|
|
55
59
|
|
|
56
60
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* @param adInfo - Information about the ad that was expanded.
|
|
61
|
+
* Called when the ad is expanded.
|
|
60
62
|
*/
|
|
61
63
|
onAdExpanded?: (adInfo: AdInfo) => void;
|
|
62
64
|
|
|
63
65
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* @param adInfo - Information about the ad that was collapsed.
|
|
66
|
+
* Called when the ad collapses back to its original state.
|
|
67
67
|
*/
|
|
68
68
|
onAdCollapsed?: (adInfo: AdInfo) => void;
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
72
|
+
* Options used when preloading a native UI {@link AdView} component.
|
|
73
73
|
*/
|
|
74
74
|
export type NativeUIComponentAdViewOptions = {
|
|
75
75
|
/**
|
|
76
|
-
*
|
|
77
|
-
|
|
76
|
+
* Whether adaptive banner sizing is enabled. Defaults to `true`.
|
|
77
|
+
*/
|
|
78
|
+
isAdaptive?: boolean;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The placement name used for analytics and reporting.
|
|
78
82
|
*/
|
|
79
83
|
placement?: string | null;
|
|
80
84
|
|
|
81
85
|
/**
|
|
82
|
-
*
|
|
86
|
+
* Custom data to associate with the ad for postbacks or targeting.
|
|
83
87
|
*/
|
|
84
88
|
customData?: string | null;
|
|
85
89
|
|
|
86
90
|
/**
|
|
87
|
-
* A dictionary value
|
|
88
|
-
*
|
|
91
|
+
* A dictionary of key-value pairs used to pass extra parameters
|
|
92
|
+
* to the SDK (string-only values).
|
|
89
93
|
*/
|
|
90
94
|
extraParameters?: { [key: string]: string | null };
|
|
91
95
|
|
|
92
96
|
/**
|
|
93
|
-
* A dictionary value
|
|
94
|
-
* to
|
|
97
|
+
* A dictionary of key-value pairs used to pass local extra parameters
|
|
98
|
+
* to the mediation adapter (string, boolean, number, etc.).
|
|
95
99
|
*/
|
|
96
100
|
localExtraParameters?: { [key: string]: LocalExtraParameterValue };
|
|
97
101
|
};
|