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
|
@@ -1,8 +1,28 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
/**
|
|
3
|
+
* Provides pre-styled React Native components for each native ad asset view:
|
|
4
|
+
*
|
|
5
|
+
* - TitleView
|
|
6
|
+
* - AdvertiserView
|
|
7
|
+
* - BodyView
|
|
8
|
+
* - CallToActionView
|
|
9
|
+
* - IconView
|
|
10
|
+
* - OptionsView
|
|
11
|
+
* - MediaView
|
|
12
|
+
* - StarRatingView
|
|
13
|
+
*
|
|
14
|
+
* Each component pulls ad content and view refs from NativeAdView context,
|
|
15
|
+
* and must be rendered inside a {@link NativeAdView}.
|
|
16
|
+
*/
|
|
17
|
+
|
|
2
18
|
import * as React from 'react';
|
|
3
19
|
import { useContext, useMemo } from 'react';
|
|
4
20
|
import { Text, Image, View, TouchableOpacity, StyleSheet, Platform } from 'react-native';
|
|
5
21
|
import { NativeAdViewContext } from './NativeAdViewProvider';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Renders the native ad’s title.
|
|
25
|
+
*/
|
|
6
26
|
export const TitleView = props => {
|
|
7
27
|
const {
|
|
8
28
|
titleRef,
|
|
@@ -12,6 +32,10 @@ export const TitleView = props => {
|
|
|
12
32
|
ref: titleRef
|
|
13
33
|
}), nativeAd.title ?? '');
|
|
14
34
|
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Renders the advertiser name.
|
|
38
|
+
*/
|
|
15
39
|
export const AdvertiserView = props => {
|
|
16
40
|
const {
|
|
17
41
|
advertiserRef,
|
|
@@ -21,6 +45,10 @@ export const AdvertiserView = props => {
|
|
|
21
45
|
ref: advertiserRef
|
|
22
46
|
}), nativeAd.advertiser ?? '');
|
|
23
47
|
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Renders the ad’s body text (description).
|
|
51
|
+
*/
|
|
24
52
|
export const BodyView = props => {
|
|
25
53
|
const {
|
|
26
54
|
bodyRef,
|
|
@@ -30,29 +58,37 @@ export const BodyView = props => {
|
|
|
30
58
|
ref: bodyRef
|
|
31
59
|
}), nativeAd.body ?? '');
|
|
32
60
|
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Renders the call-to-action label.
|
|
64
|
+
* On iOS, wraps the text with a TouchableOpacity for better click behavior.
|
|
65
|
+
*/
|
|
33
66
|
export const CallToActionView = props => {
|
|
34
67
|
const {
|
|
35
68
|
callToActionRef,
|
|
36
69
|
nativeAd
|
|
37
70
|
} = useContext(NativeAdViewContext);
|
|
38
|
-
// TouchableOpacity disables clicking on certain Android devices.
|
|
39
71
|
if (Platform.OS === 'android') {
|
|
40
72
|
return /*#__PURE__*/React.createElement(Text, _extends({}, props, {
|
|
41
73
|
ref: callToActionRef
|
|
42
74
|
}), nativeAd.callToAction ?? '');
|
|
43
|
-
} else {
|
|
44
|
-
return /*#__PURE__*/React.createElement(TouchableOpacity, null, /*#__PURE__*/React.createElement(Text, _extends({}, props, {
|
|
45
|
-
ref: callToActionRef
|
|
46
|
-
}), nativeAd.callToAction ?? ''));
|
|
47
75
|
}
|
|
76
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, null, /*#__PURE__*/React.createElement(Text, _extends({}, props, {
|
|
77
|
+
ref: callToActionRef
|
|
78
|
+
}), nativeAd.callToAction ?? ''));
|
|
48
79
|
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Renders the icon image for the native ad.
|
|
83
|
+
* Falls back to a blank placeholder if not available.
|
|
84
|
+
*/
|
|
49
85
|
export const IconView = props => {
|
|
50
86
|
const {
|
|
51
87
|
imageRef,
|
|
52
88
|
nativeAd
|
|
53
89
|
} = useContext(NativeAdViewContext);
|
|
54
90
|
const defaultIcon = require('./img/blank_icon.png');
|
|
55
|
-
const imageSource = (() => {
|
|
91
|
+
const imageSource = useMemo(() => {
|
|
56
92
|
if (nativeAd !== null && nativeAd !== void 0 && nativeAd.url) {
|
|
57
93
|
return {
|
|
58
94
|
uri: nativeAd.url
|
|
@@ -64,12 +100,16 @@ export const IconView = props => {
|
|
|
64
100
|
};
|
|
65
101
|
}
|
|
66
102
|
return defaultIcon;
|
|
67
|
-
})
|
|
103
|
+
}, [nativeAd.url, nativeAd.imageSource, defaultIcon]);
|
|
68
104
|
return /*#__PURE__*/React.createElement(Image, _extends({}, props, {
|
|
69
105
|
ref: imageRef,
|
|
70
106
|
source: imageSource
|
|
71
107
|
}));
|
|
72
108
|
};
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Renders the native ad’s options view.
|
|
112
|
+
*/
|
|
73
113
|
export const OptionsView = props => {
|
|
74
114
|
const {
|
|
75
115
|
optionViewRef
|
|
@@ -78,6 +118,10 @@ export const OptionsView = props => {
|
|
|
78
118
|
ref: optionViewRef
|
|
79
119
|
}));
|
|
80
120
|
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Renders the native ad’s media content.
|
|
124
|
+
*/
|
|
81
125
|
export const MediaView = props => {
|
|
82
126
|
const {
|
|
83
127
|
mediaViewRef
|
|
@@ -86,58 +130,61 @@ export const MediaView = props => {
|
|
|
86
130
|
ref: mediaViewRef
|
|
87
131
|
}));
|
|
88
132
|
};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Props for the {@link StarRatingView} component, which displays a star rating
|
|
136
|
+
* using Unicode stars (★ and ☆) styled with color, shadow, and size.
|
|
137
|
+
*/
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Renders the star rating of the ad, using Unicode stars (★ and ☆).
|
|
141
|
+
* Filled stars are rendered over hollow stars using a clipped view.
|
|
142
|
+
*/
|
|
143
|
+
export const StarRatingView = ({
|
|
144
|
+
color = '#ffe234',
|
|
145
|
+
shadowColor = '#dedede',
|
|
146
|
+
size = 10,
|
|
147
|
+
style
|
|
148
|
+
}) => {
|
|
98
149
|
const {
|
|
99
150
|
nativeAd
|
|
100
151
|
} = useContext(NativeAdViewContext);
|
|
101
|
-
|
|
102
|
-
|
|
152
|
+
const maxStarCount = 5;
|
|
153
|
+
const containerStyle = useMemo(() => StyleSheet.flatten([style, styles.starRatingContainer]), [style]);
|
|
103
154
|
const stars = useMemo(() => {
|
|
104
|
-
|
|
105
|
-
return Array.from({
|
|
106
|
-
length: maxStarCount
|
|
107
|
-
}).map((_, index) => /*#__PURE__*/React.createElement(Text, {
|
|
108
|
-
key: index,
|
|
109
|
-
style: {
|
|
110
|
-
fontSize: starSize
|
|
111
|
-
}
|
|
112
|
-
}, ' '));
|
|
113
|
-
}
|
|
155
|
+
const starRating = Math.max(0, Math.min(maxStarCount, nativeAd.starRating ?? 0));
|
|
114
156
|
return Array.from({
|
|
115
157
|
length: maxStarCount
|
|
116
158
|
}).map((_, index) => {
|
|
117
|
-
const
|
|
118
|
-
const width = (starRating - index) *
|
|
159
|
+
const isFull = starRating > index;
|
|
160
|
+
const width = Math.min(size, Math.max(0, (starRating - index) * size));
|
|
119
161
|
return /*#__PURE__*/React.createElement(View, {
|
|
120
162
|
key: index
|
|
121
163
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
122
164
|
style: {
|
|
123
|
-
fontSize:
|
|
124
|
-
color:
|
|
165
|
+
fontSize: size,
|
|
166
|
+
color: isFull ? color : shadowColor
|
|
125
167
|
}
|
|
126
|
-
}, String.fromCodePoint(0x2606)),
|
|
168
|
+
}, String.fromCodePoint(0x2606)), isFull && /*#__PURE__*/React.createElement(View, {
|
|
127
169
|
style: [{
|
|
128
|
-
width
|
|
170
|
+
width
|
|
129
171
|
}, styles.starRating]
|
|
130
172
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
131
173
|
style: {
|
|
132
|
-
fontSize:
|
|
133
|
-
color
|
|
174
|
+
fontSize: size,
|
|
175
|
+
color
|
|
134
176
|
}
|
|
135
177
|
}, String.fromCodePoint(0x2605))));
|
|
136
178
|
});
|
|
137
|
-
}, [nativeAd.starRating,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
179
|
+
}, [nativeAd.starRating, color, shadowColor, size]);
|
|
180
|
+
if (!nativeAd.starRating) {
|
|
181
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
182
|
+
style: containerStyle
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
186
|
+
style: containerStyle
|
|
187
|
+
}, stars);
|
|
141
188
|
};
|
|
142
189
|
const styles = StyleSheet.create({
|
|
143
190
|
starRatingContainer: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useContext","useMemo","Text","Image","View","TouchableOpacity","StyleSheet","Platform","NativeAdViewContext","TitleView","props","titleRef","nativeAd","createElement","_extends","ref","title","AdvertiserView","advertiserRef","advertiser","BodyView","bodyRef","body","CallToActionView","callToActionRef","OS","callToAction","IconView","imageRef","defaultIcon","require","imageSource","url","uri","source","OptionsView","optionViewRef","MediaView","mediaViewRef","StarRatingView","
|
|
1
|
+
{"version":3,"names":["React","useContext","useMemo","Text","Image","View","TouchableOpacity","StyleSheet","Platform","NativeAdViewContext","TitleView","props","titleRef","nativeAd","createElement","_extends","ref","title","AdvertiserView","advertiserRef","advertiser","BodyView","bodyRef","body","CallToActionView","callToActionRef","OS","callToAction","IconView","imageRef","defaultIcon","require","imageSource","url","uri","source","OptionsView","optionViewRef","MediaView","mediaViewRef","StarRatingView","color","shadowColor","size","style","maxStarCount","containerStyle","flatten","styles","starRatingContainer","stars","starRating","Math","max","min","Array","from","length","map","_","index","isFull","width","key","fontSize","String","fromCodePoint","create","flexDirection","alignItems","overflow","position"],"sourceRoot":"../../../src","sources":["nativeAd/NativeAdViewComponents.tsx"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAC3C,SAASC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,cAAc;AAExF,SAASC,mBAAmB,QAAQ,wBAAwB;;AAE5D;AACA;AACA;AACA,OAAO,MAAMC,SAAS,GAAIC,KAAgB,IAAK;EAC3C,MAAM;IAAEC,QAAQ;IAAEC;EAAS,CAAC,GAAGZ,UAAU,CAACQ,mBAAmB,CAAC;EAC9D,oBACIT,KAAA,CAAAc,aAAA,CAACX,IAAI,EAAAY,QAAA,KAAKJ,KAAK;IAAEK,GAAG,EAAEJ;EAAS,IAC1BC,QAAQ,CAACI,KAAK,IAAI,EACjB,CAAC;AAEf,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAIP,KAAgB,IAAK;EAChD,MAAM;IAAEQ,aAAa;IAAEN;EAAS,CAAC,GAAGZ,UAAU,CAACQ,mBAAmB,CAAC;EACnE,oBACIT,KAAA,CAAAc,aAAA,CAACX,IAAI,EAAAY,QAAA,K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AAEoB,QAAQ,EAAErB,IAAI;UAAEF;QAAM;MAAE,GAAEwB,MAAM,CAACC,aAAa,CAAC,MAAM,CAAQ,CAC1E,CAER,CAAC;IAEf,CAAC,CAAC;EACN,CAAC,EAAE,CAACrD,QAAQ,CAACsC,UAAU,EAAEV,KAAK,EAAEC,WAAW,EAAEC,IAAI,CAAC,CAAC;EAEnD,IAAI,CAAC9B,QAAQ,CAACsC,UAAU,EAAE;IACtB,oBAAOnD,KAAA,CAAAc,aAAA,CAACT,IAAI;MAACuC,KAAK,EAAEE;IAAe,CAAE,CAAC;EAC1C;EAEA,oBAAO9C,KAAA,CAAAc,aAAA,CAACT,IAAI;IAACuC,KAAK,EAAEE;EAAe,GAAEI,KAAY,CAAC;AACtD,CAAC;AAED,MAAMF,MAAM,GAAGzC,UAAU,CAAC4D,MAAM,CAAC;EAC7BlB,mBAAmB,EAAE;IACjBmB,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EAChB,CAAC;EACDlB,UAAU,EAAE;IACRmB,QAAQ,EAAE,QAAQ;IAClBC,QAAQ,EAAE;EACd;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provides context and state management for NativeAdView and its child asset views.
|
|
3
|
+
* Shares asset view refs and native ad data between internal components and the native SDK.
|
|
4
|
+
*/
|
|
5
|
+
|
|
1
6
|
import * as React from 'react';
|
|
2
7
|
import { useState, createContext, useRef } from 'react';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Native component type for the rendered NativeAdView.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Ref types for native views
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Context type used internally by NativeAdView.
|
|
17
|
+
* Stores references to asset views and the current native ad data.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
// Default for an uninitialized native ad
|
|
3
21
|
const defaultNativeAd = {
|
|
4
22
|
isOptionsViewAvailable: false,
|
|
5
23
|
isMediaViewAvailable: false
|
|
6
24
|
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Internal context used by NativeAdView to provide access to asset view refs and native ad data.
|
|
28
|
+
*/
|
|
7
29
|
export const NativeAdViewContext = /*#__PURE__*/createContext({
|
|
8
30
|
titleRef: {
|
|
9
31
|
current: null
|
|
@@ -29,6 +51,10 @@ export const NativeAdViewContext = /*#__PURE__*/createContext({
|
|
|
29
51
|
nativeAd: defaultNativeAd,
|
|
30
52
|
setNativeAd: () => {}
|
|
31
53
|
});
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* React provider that wraps components requiring access to NativeAdViewContext.
|
|
57
|
+
*/
|
|
32
58
|
export const NativeAdViewProvider = ({
|
|
33
59
|
children
|
|
34
60
|
}) => {
|
|
@@ -40,6 +66,10 @@ export const NativeAdViewProvider = ({
|
|
|
40
66
|
const optionViewRef = useRef(null);
|
|
41
67
|
const mediaViewRef = useRef(null);
|
|
42
68
|
const [nativeAd, setNativeAd] = useState(defaultNativeAd);
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Memoized context value to avoid unnecessary renders.
|
|
72
|
+
*/
|
|
43
73
|
const providerValue = React.useMemo(() => ({
|
|
44
74
|
titleRef,
|
|
45
75
|
advertiserRef,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","createContext","useRef","defaultNativeAd","isOptionsViewAvailable","isMediaViewAvailable","NativeAdViewContext","titleRef","current","advertiserRef","bodyRef","callToActionRef","imageRef","optionViewRef","mediaViewRef","nativeAd","setNativeAd","NativeAdViewProvider","children","providerValue","useMemo","createElement","Provider","value"],"sourceRoot":"../../../src","sources":["nativeAd/NativeAdViewProvider.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,EAAEC,aAAa,EAAEC,MAAM,QAAQ,OAAO;
|
|
1
|
+
{"version":3,"names":["React","useState","createContext","useRef","defaultNativeAd","isOptionsViewAvailable","isMediaViewAvailable","NativeAdViewContext","titleRef","current","advertiserRef","bodyRef","callToActionRef","imageRef","optionViewRef","mediaViewRef","nativeAd","setNativeAd","NativeAdViewProvider","children","providerValue","useMemo","createElement","Provider","value"],"sourceRoot":"../../../src","sources":["nativeAd/NativeAdViewProvider.tsx"],"mappings":"AAAA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,EAAEC,aAAa,EAAEC,MAAM,QAAQ,OAAO;;AAMvD;AACA;AACA;;AAGA;;AAKA;AACA;AACA;AACA;;AAaA;AACA,MAAMC,eAAyB,GAAG;EAC9BC,sBAAsB,EAAE,KAAK;EAC7BC,oBAAoB,EAAE;AAC1B,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,gBAAGL,aAAa,CAA0B;EACtEM,QAAQ,EAAE;IAAEC,OAAO,EAAE;EAAK,CAAC;EAC3BC,aAAa,EAAE;IAAED,OAAO,EAAE;EAAK,CAAC;EAChCE,OAAO,EAAE;IAAEF,OAAO,EAAE;EAAK,CAAC;EAC1BG,eAAe,EAAE;IAAEH,OAAO,EAAE;EAAK,CAAC;EAClCI,QAAQ,EAAE;IAAEJ,OAAO,EAAE;EAAK,CAAC;EAC3BK,aAAa,EAAE;IAAEL,OAAO,EAAE;EAAK,CAAC;EAChCM,YAAY,EAAE;IAAEN,OAAO,EAAE;EAAK,CAAC;EAC/BO,QAAQ,EAAEZ,eAAe;EACzBa,WAAW,EAAEA,CAAA,KAAM,CAAC;AACxB,CAAC,CAAC;;AAEF;AACA;AACA;AACA,OAAO,MAAMC,oBAAuD,GAAGA,CAAC;EAAEC;AAAS,CAAC,KAAK;EACrF,MAAMX,QAAQ,GAAGL,MAAM,CAAiB,IAAI,CAAC;EAC7C,MAAMO,aAAa,GAAGP,MAAM,CAAiB,IAAI,CAAC;EAClD,MAAMQ,OAAO,GAAGR,MAAM,CAAiB,IAAI,CAAC;EAC5C,MAAMS,eAAe,GAAGT,MAAM,CAAiB,IAAI,CAAC;EACpD,MAAMU,QAAQ,GAAGV,MAAM,CAAkB,IAAI,CAAC;EAC9C,MAAMW,aAAa,GAAGX,MAAM,CAAiB,IAAI,CAAC;EAClD,MAAMY,YAAY,GAAGZ,MAAM,CAAiB,IAAI,CAAC;EACjD,MAAM,CAACa,QAAQ,EAAEC,WAAW,CAAC,GAAGhB,QAAQ,CAAWG,eAAe,CAAC;;EAEnE;AACJ;AACA;EACI,MAAMgB,aAAa,GAAGpB,KAAK,CAACqB,OAAO,CAC/B,OAAO;IACHb,QAAQ;IACRE,aAAa;IACbC,OAAO;IACPC,eAAe;IACfC,QAAQ;IACRC,aAAa;IACbC,YAAY;IACZC,QAAQ;IACRC;EACJ,CAAC,CAAC,EACF,CAACD,QAAQ,CACb,CAAC;EAED,oBAAOhB,KAAA,CAAAsB,aAAA,CAACf,mBAAmB,CAACgB,QAAQ;IAACC,KAAK,EAAEJ;EAAc,GAAED,QAAuC,CAAC;AACxG,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,35 @@
|
|
|
1
1
|
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
|
|
2
2
|
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Payload for ad lifecycle events (e.g. load, display, click).
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Payload for ad load failure events.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Payload for ad display failure events.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Props passed to the {@link AppLovinMAXAdView} native component.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Native commands callable from JS for managing {@link AppLovinMAXAdView}.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* JS interface to ad view commands for {@link AppLovinMAXAdView}.
|
|
26
|
+
*/
|
|
3
27
|
export const Commands = codegenNativeCommands({
|
|
4
28
|
supportedCommands: ['loadAd']
|
|
5
29
|
});
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Native view component for displaying a banner or MREC ad.
|
|
33
|
+
*/
|
|
6
34
|
export default codegenNativeComponent('AppLovinMAXAdView');
|
|
7
35
|
//# sourceMappingURL=AppLovinMAXAdViewNativeComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["codegenNativeCommands","codegenNativeComponent","Commands","supportedCommands"],"sourceRoot":"../../../src","sources":["specs/AppLovinMAXAdViewNativeComponent.ts"],"mappings":"AAEA,OAAOA,qBAAqB,MAAM,wDAAwD;AAC1F,OAAOC,sBAAsB,MAAM,yDAAyD;
|
|
1
|
+
{"version":3,"names":["codegenNativeCommands","codegenNativeComponent","Commands","supportedCommands"],"sourceRoot":"../../../src","sources":["specs/AppLovinMAXAdViewNativeComponent.ts"],"mappings":"AAEA,OAAOA,qBAAqB,MAAM,wDAAwD;AAC1F,OAAOC,sBAAsB,MAAM,yDAAyD;;AAE5F;AACA;AACA;;AAmBA;AACA;AACA;;AAWA;AACA;AACA;;AAuBA;AACA;AACA;;AAoEA;AACA;AACA;;AAUA;AACA;AACA;AACA,OAAO,MAAMC,QAAwB,GAAGF,qBAAqB,CAAiB;EAC1EG,iBAAiB,EAAE,CAAC,QAAQ;AAChC,CAAC,CAAC;;AAEF;AACA;AACA;AACA,eAAeF,sBAAsB,CAAc,mBAAmB,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,31 @@
|
|
|
1
1
|
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
|
|
2
2
|
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Payload for native ad lifecycle events (e.g., load, click, revenue).
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Payload for native ad load failure events.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Props passed to the {@link AppLovinMAXNativeAdView} native component.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Native commands callable from JS for managing {@link NativeAdView}.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* JS interface to native ad view commands for {@link AppLovinMAXNativeAdView}.
|
|
22
|
+
*/
|
|
3
23
|
export const Commands = codegenNativeCommands({
|
|
4
24
|
supportedCommands: ['loadAd', 'updateAssetView', 'renderNativeAd']
|
|
5
25
|
});
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Native component for rendering a custom native ad layout using bound asset views.
|
|
29
|
+
*/
|
|
6
30
|
export default codegenNativeComponent('AppLovinMAXNativeAdView');
|
|
7
31
|
//# sourceMappingURL=AppLovinMAXNativeAdViewNativeComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["codegenNativeCommands","codegenNativeComponent","Commands","supportedCommands"],"sourceRoot":"../../../src","sources":["specs/AppLovinMAXNativeAdViewNativeComponent.ts"],"mappings":"AAEA,OAAOA,qBAAqB,MAAM,wDAAwD;AAC1F,OAAOC,sBAAsB,MAAM,yDAAyD;
|
|
1
|
+
{"version":3,"names":["codegenNativeCommands","codegenNativeComponent","Commands","supportedCommands"],"sourceRoot":"../../../src","sources":["specs/AppLovinMAXNativeAdViewNativeComponent.ts"],"mappings":"AAEA,OAAOA,qBAAqB,MAAM,wDAAwD;AAC1F,OAAOC,sBAAsB,MAAM,yDAAyD;;AAE5F;AACA;AACA;;AAiDA;AACA;AACA;;AAUA;AACA;AACA;;AA4CA;AACA;AACA;;AA0BA;AACA;AACA;AACA,OAAO,MAAMC,QAAwB,GAAGF,qBAAqB,CAAiB;EAC1EG,iBAAiB,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,gBAAgB;AACrE,CAAC,CAAC;;AAEF;AACA;AACA;AACA,eAAeF,sBAAsB,CAAc,yBAAyB,CAAC","ignoreList":[]}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
import { TurboModuleRegistry } from 'react-native';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Native TurboModule interface for AppLovin MAX.
|
|
5
|
+
* Defines all methods and constants exposed to JavaScript.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Enforces use of the native AppLovinMAX TurboModule.
|
|
10
|
+
*/
|
|
2
11
|
export default TurboModuleRegistry.getEnforcing('AppLovinMAX');
|
|
3
12
|
//# sourceMappingURL=NativeAppLovinMAXModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeAppLovinMAXModule.ts"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,cAAc;
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeAppLovinMAXModule.ts"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,cAAc;;AAOlD;AACA;AACA;AACA;;AAuNA;AACA;AACA;AACA,eAAeA,mBAAmB,CAACC,YAAY,CAAO,aAAa,CAAC","ignoreList":[]}
|
|
@@ -1,58 +1,55 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Represents
|
|
2
|
+
* Represents a successfully loaded ad served by AppLovin MAX.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Represents a failure when attempting to load an ad.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Represents an error that occurred when displaying an ad.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Represents a reward
|
|
14
|
+
* Represents a successful reward event from a rewarded ad.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Describes metadata for a native ad, including asset availability.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
* responses, etc.
|
|
22
|
+
* Contains metadata about the ad waterfall evaluated during an ad request.
|
|
24
23
|
*/
|
|
25
24
|
|
|
26
25
|
/**
|
|
27
|
-
*
|
|
28
|
-
* Each adapter response {@link AdNetworkResponseInfo} corresponds to one of these states.
|
|
26
|
+
* Enumeration of possible ad load states for each network in the waterfall.
|
|
29
27
|
*/
|
|
30
28
|
export let AdLoadState = /*#__PURE__*/function (AdLoadState) {
|
|
31
29
|
/**
|
|
32
|
-
*
|
|
33
|
-
* an ad higher in the waterfall loaded successfully.
|
|
30
|
+
* SDK did not attempt to load an ad from this network.
|
|
34
31
|
*/
|
|
35
32
|
AdLoadState[AdLoadState["LoadStateAdLoadNotAttempted"] = 0] = "LoadStateAdLoadNotAttempted";
|
|
36
33
|
/**
|
|
37
|
-
* An ad successfully loaded from this network.
|
|
34
|
+
* An ad was successfully loaded from this network.
|
|
38
35
|
*/
|
|
39
36
|
AdLoadState[AdLoadState["LoadStateAdLoaded"] = 1] = "LoadStateAdLoaded";
|
|
40
37
|
/**
|
|
41
|
-
*
|
|
38
|
+
* The network failed to load an ad.
|
|
42
39
|
*/
|
|
43
40
|
AdLoadState[AdLoadState["LoadStateAdFailedToLoad"] = 2] = "LoadStateAdFailedToLoad";
|
|
44
41
|
return AdLoadState;
|
|
45
42
|
}({});
|
|
46
43
|
|
|
47
44
|
/**
|
|
48
|
-
*
|
|
45
|
+
* General error info object used in waterfall response details.
|
|
49
46
|
*/
|
|
50
47
|
|
|
51
48
|
/**
|
|
52
|
-
*
|
|
49
|
+
* Contains information about a single mediated network response.
|
|
53
50
|
*/
|
|
54
51
|
|
|
55
52
|
/**
|
|
56
|
-
*
|
|
53
|
+
* Metadata about a mediated ad network.
|
|
57
54
|
*/
|
|
58
55
|
//# sourceMappingURL=AdInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AdLoadState"],"sourceRoot":"../../../src","sources":["types/AdInfo.ts"],"mappings":"AAGA;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["AdLoadState"],"sourceRoot":"../../../src","sources":["types/AdInfo.ts"],"mappings":"AAGA;AACA;AACA;;AAwFA;AACA;AACA;;AA2CA;AACA;AACA;;AAuBA;AACA;AACA;;AAaA;AACA;AACA;;AAgDA;AACA;AACA;;AAuBA;AACA;AACA;AACA,WAAYA,WAAW,0BAAXA,WAAW;EACnB;AACJ;AACA;EAHYA,WAAW,CAAXA,WAAW;EAMnB;AACJ;AACA;EARYA,WAAW,CAAXA,WAAW;EAWnB;AACJ;AACA;EAbYA,WAAW,CAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;;AAiBvB;AACA;AACA;;AAkBA;AACA;AACA;;AA+BA;AACA;AACA","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@ import type { ViewProps } from 'react-native';
|
|
|
3
3
|
import type { AdInfo, AdLoadFailedInfo } from './types/AdInfo';
|
|
4
4
|
import type { AdViewHandler, NativeUIComponentAdViewOptions, AdViewId } from './types/AdViewProps';
|
|
5
5
|
/**
|
|
6
|
-
* Defines
|
|
6
|
+
* Defines the format of an ad.
|
|
7
7
|
*/
|
|
8
8
|
export declare enum AdFormat {
|
|
9
9
|
/**
|
|
@@ -16,7 +16,7 @@ export declare enum AdFormat {
|
|
|
16
16
|
MREC = "MREC"
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
* Defines
|
|
19
|
+
* Defines the position for rendering a banner or MREC ad within its container.
|
|
20
20
|
*/
|
|
21
21
|
export declare enum AdViewPosition {
|
|
22
22
|
TOP_CENTER = "top_center",
|
|
@@ -30,32 +30,41 @@ export declare enum AdViewPosition {
|
|
|
30
30
|
BOTTOM_RIGHT = "bottom_right"
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
34
|
-
* - **Banners**: 320x50 on phones, 728x90 on tablets.
|
|
35
|
-
* - **MRECs**: 300x250 on all devices.
|
|
33
|
+
* Renders a banner or MREC ad using a native view, with adaptive or responsive sizing.
|
|
36
34
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
35
|
+
* - **Banners**: 320×50 on phones, 728×90 on tablets.
|
|
36
|
+
* - **MRECs**: Fixed size of 300×250 on all devices.
|
|
37
|
+
*
|
|
38
|
+
* Internally uses {@link AppLovinMAX.isTablet()} to determine banner size on tablets.
|
|
39
|
+
* You can also use this method externally to assist with layout decisions.
|
|
40
|
+
*
|
|
41
|
+
* For adaptive banners, use {@link BannerAd.getAdaptiveHeightForWidth()} to determine the appropriate height.
|
|
39
42
|
*
|
|
40
43
|
* **Preloading**:
|
|
41
|
-
*
|
|
42
|
-
* the returned {@link AdViewId}
|
|
44
|
+
* If you preload an ad for AdView using {@link preloadNativeUIComponentAdView},
|
|
45
|
+
* pass the returned {@link AdViewId} to this component to display the preloaded instance.
|
|
46
|
+
*
|
|
47
|
+
* **Note:** The AppLovin SDK must be initialized before using this component.
|
|
43
48
|
*
|
|
44
49
|
* ### Example:
|
|
45
|
-
* ```
|
|
50
|
+
* ```tsx
|
|
46
51
|
* <AdView
|
|
47
52
|
* adUnitId={adUnitId}
|
|
48
53
|
* adFormat={AdFormat.BANNER}
|
|
49
54
|
* placement="my_placement"
|
|
50
55
|
* customData="my_customData"
|
|
51
|
-
* extraParameters={{
|
|
52
|
-
* localExtraParameters={{
|
|
56
|
+
* extraParameters={{ key1: "value1", key2: "value2" }}
|
|
57
|
+
* localExtraParameters={{ key1: "value1", key2: true }}
|
|
53
58
|
* adaptiveBannerEnabled={false}
|
|
54
59
|
* autoRefresh={false}
|
|
55
60
|
* style={styles.banner}
|
|
56
61
|
* onAdLoaded={(adInfo: AdInfo) => { ... }}
|
|
57
62
|
* />
|
|
58
63
|
* ```
|
|
64
|
+
*
|
|
65
|
+
* For complete implementation examples, see:
|
|
66
|
+
* - https://github.com/AppLovin/AppLovin-MAX-React-Native/blob/master/example/src/NativeBannerExample.tsx
|
|
67
|
+
* - https://github.com/AppLovin/AppLovin-MAX-React-Native/blob/master/example/src/NativeMRecExample.tsx
|
|
59
68
|
*/
|
|
60
69
|
export declare const AdView: React.ForwardRefExoticComponent<import("./types/AdProps").AdProps & {
|
|
61
70
|
adFormat: AdFormat;
|
|
@@ -73,10 +82,10 @@ export declare const AdView: React.ForwardRefExoticComponent<import("./types/AdP
|
|
|
73
82
|
* - Unmounting {@link AdView} does not destroy the preloaded component—it will be reused on the next mount.
|
|
74
83
|
* - You must manually destroy the preloaded component when it is no longer needed using {@link destroyNativeUIComponentAdView}.
|
|
75
84
|
*
|
|
76
|
-
* @param adUnitId - The Ad Unit ID for which
|
|
85
|
+
* @param adUnitId - The Ad Unit ID for which ads should be preloaded.
|
|
77
86
|
* @param adFormat - The ad format to preload. Must be either {@link AdFormat.BANNER} or {@link AdFormat.MREC}.
|
|
78
87
|
* @param options - Optional properties to configure the native UI component (e.g., placement, custom data).
|
|
79
|
-
* @returns A promise
|
|
88
|
+
* @returns A promise that resolves to an {@link AdViewId}, uniquely identifying the preloaded component instance.
|
|
80
89
|
* @throws An error if the preload request fails.
|
|
81
90
|
*/
|
|
82
91
|
export declare const preloadNativeUIComponentAdView: (adUnitId: string, adFormat: AdFormat, options?: NativeUIComponentAdViewOptions) => Promise<AdViewId>;
|
|
@@ -91,26 +100,23 @@ export declare const preloadNativeUIComponentAdView: (adUnitId: string, adFormat
|
|
|
91
100
|
*/
|
|
92
101
|
export declare const destroyNativeUIComponentAdView: (adViewId: AdViewId) => Promise<void>;
|
|
93
102
|
/**
|
|
94
|
-
* Adds the specified event listener to receive {@link AdInfo} when a native UI component loads a
|
|
95
|
-
* new ad.
|
|
103
|
+
* Adds the specified event listener to receive {@link AdInfo} when a native UI component loads a new ad.
|
|
96
104
|
*
|
|
97
105
|
* @param listener Listener to be notified.
|
|
98
106
|
*/
|
|
99
107
|
export declare const addNativeUIComponentAdViewAdLoadedEventListener: (listener: (adInfo: AdInfo) => void) => void;
|
|
100
108
|
/**
|
|
101
|
-
* Removes the event listener to receive {@link AdInfo} when a native UI component loads a new ad.
|
|
109
|
+
* Removes the event listener registered to receive {@link AdInfo} when a native UI component loads a new ad.
|
|
102
110
|
*/
|
|
103
111
|
export declare const removeNativeUIComponentAdViewAdLoadedEventListener: () => void;
|
|
104
112
|
/**
|
|
105
|
-
* Adds the specified event listener to receive {@link AdLoadFailedInfo} when a native UI component
|
|
106
|
-
* could not load a new ad.
|
|
113
|
+
* Adds the specified event listener to receive {@link AdLoadFailedInfo} when a native UI component could not load a new ad.
|
|
107
114
|
*
|
|
108
115
|
* @param listener Listener to be notified.
|
|
109
116
|
*/
|
|
110
117
|
export declare const addNativeUIComponentAdViewAdLoadFailedEventListener: (listener: (errorInfo: AdLoadFailedInfo) => void) => void;
|
|
111
118
|
/**
|
|
112
|
-
* Removes the event listener to receive {@link AdLoadFailedInfo} when a native UI component could
|
|
113
|
-
* not load a new ad.
|
|
119
|
+
* Removes the event listener registered to receive {@link AdLoadFailedInfo} when a native UI component could not load a new ad.
|
|
114
120
|
*/
|
|
115
121
|
export declare const removeNativeUIComponentAdViewAdLoadFailedEventListener: () => void;
|
|
116
122
|
//# sourceMappingURL=AdView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdView.d.ts","sourceRoot":"","sources":["../../../src/AdView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAwB,SAAS,EAAwC,MAAM,cAAc,CAAC;AAK1G,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,KAAK,EAAe,aAAa,EAAE,8BAA8B,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAKhH;;GA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