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
|
@@ -5,8 +5,16 @@ import type { Configuration } from '../types';
|
|
|
5
5
|
import type { CMPError } from '../types';
|
|
6
6
|
import type { AdViewId } from '../types';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Native TurboModule interface for AppLovin MAX.
|
|
10
|
+
* Defines all methods and constants exposed to JavaScript.
|
|
11
|
+
*/
|
|
8
12
|
export interface Spec extends TurboModule {
|
|
13
|
+
/**
|
|
14
|
+
* Returns all supported event constants and SDK error codes.
|
|
15
|
+
*/
|
|
9
16
|
readonly getConstants: () => {
|
|
17
|
+
// Interstitial ad events
|
|
10
18
|
ON_INTERSTITIAL_LOADED_EVENT: string;
|
|
11
19
|
ON_INTERSTITIAL_LOAD_FAILED_EVENT: string;
|
|
12
20
|
ON_INTERSTITIAL_CLICKED_EVENT: string;
|
|
@@ -14,6 +22,8 @@ export interface Spec extends TurboModule {
|
|
|
14
22
|
ON_INTERSTITIAL_AD_FAILED_TO_DISPLAY_EVENT: string;
|
|
15
23
|
ON_INTERSTITIAL_HIDDEN_EVENT: string;
|
|
16
24
|
ON_INTERSTITIAL_AD_REVENUE_PAID: string;
|
|
25
|
+
|
|
26
|
+
// Rewarded ad events
|
|
17
27
|
ON_REWARDED_AD_LOADED_EVENT: string;
|
|
18
28
|
ON_REWARDED_AD_LOAD_FAILED_EVENT: string;
|
|
19
29
|
ON_REWARDED_AD_CLICKED_EVENT: string;
|
|
@@ -22,18 +32,24 @@ export interface Spec extends TurboModule {
|
|
|
22
32
|
ON_REWARDED_AD_HIDDEN_EVENT: string;
|
|
23
33
|
ON_REWARDED_AD_RECEIVED_REWARD_EVENT: string;
|
|
24
34
|
ON_REWARDED_AD_REVENUE_PAID: string;
|
|
35
|
+
|
|
36
|
+
// Banner ad events
|
|
25
37
|
ON_BANNER_AD_LOADED_EVENT: string;
|
|
26
38
|
ON_BANNER_AD_LOAD_FAILED_EVENT: string;
|
|
27
39
|
ON_BANNER_AD_CLICKED_EVENT: string;
|
|
28
40
|
ON_BANNER_AD_COLLAPSED_EVENT: string;
|
|
29
41
|
ON_BANNER_AD_EXPANDED_EVENT: string;
|
|
30
42
|
ON_BANNER_AD_REVENUE_PAID: string;
|
|
43
|
+
|
|
44
|
+
// MREC ad events
|
|
31
45
|
ON_MREC_AD_LOADED_EVENT: string;
|
|
32
46
|
ON_MREC_AD_LOAD_FAILED_EVENT: string;
|
|
33
47
|
ON_MREC_AD_CLICKED_EVENT: string;
|
|
34
48
|
ON_MREC_AD_COLLAPSED_EVENT: string;
|
|
35
49
|
ON_MREC_AD_EXPANDED_EVENT: string;
|
|
36
50
|
ON_MREC_AD_REVENUE_PAID: string;
|
|
51
|
+
|
|
52
|
+
// App Open ad events
|
|
37
53
|
ON_APPOPEN_AD_LOADED_EVENT: string;
|
|
38
54
|
ON_APPOPEN_AD_LOAD_FAILED_EVENT: string;
|
|
39
55
|
ON_APPOPEN_AD_CLICKED_EVENT: string;
|
|
@@ -41,8 +57,12 @@ export interface Spec extends TurboModule {
|
|
|
41
57
|
ON_APPOPEN_AD_FAILED_TO_DISPLAY_EVENT: string;
|
|
42
58
|
ON_APPOPEN_AD_HIDDEN_EVENT: string;
|
|
43
59
|
ON_APPOPEN_AD_REVENUE_PAID: string;
|
|
60
|
+
|
|
61
|
+
// Native UI component ad events
|
|
44
62
|
ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOADED_EVENT: string;
|
|
45
63
|
ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOAD_FAILED_EVENT: string;
|
|
64
|
+
|
|
65
|
+
// Error codes
|
|
46
66
|
MAX_ERROR_CODE_UNSPECIFIED: number;
|
|
47
67
|
MAX_ERROR_CODE_NO_FILL: number;
|
|
48
68
|
MAX_ERROR_CODE_AD_LOAD_FAILED: number;
|
|
@@ -57,141 +77,136 @@ export interface Spec extends TurboModule {
|
|
|
57
77
|
MAX_ERROR_CODE_INVALID_AD_UNIT_ID: number;
|
|
58
78
|
};
|
|
59
79
|
|
|
60
|
-
|
|
80
|
+
// ─────────────────────────────────────────────────────────
|
|
81
|
+
// SDK Initialization & Configuration
|
|
82
|
+
// ─────────────────────────────────────────────────────────
|
|
61
83
|
|
|
84
|
+
isInitialized(): Promise<boolean>;
|
|
62
85
|
initialize(pluginVersion: string, sdkKey: string): Promise<Configuration>;
|
|
63
|
-
|
|
64
86
|
isTablet(): Promise<boolean>;
|
|
65
|
-
|
|
66
87
|
showMediationDebugger(): void;
|
|
67
88
|
|
|
68
|
-
|
|
89
|
+
// ─────────────────────────────────────────────────────────
|
|
90
|
+
// Privacy & Consent APIs
|
|
91
|
+
// ─────────────────────────────────────────────────────────
|
|
69
92
|
|
|
93
|
+
setHasUserConsent(hasUserConsent: boolean): void;
|
|
70
94
|
hasUserConsent(): Promise<boolean>;
|
|
71
95
|
|
|
72
96
|
setDoNotSell(doNotSell: boolean): void;
|
|
73
|
-
|
|
74
97
|
isDoNotSell(): Promise<boolean>;
|
|
75
98
|
|
|
76
|
-
|
|
99
|
+
// ─────────────────────────────────────────────────────────
|
|
100
|
+
// User & Debug Settings
|
|
101
|
+
// ─────────────────────────────────────────────────────────
|
|
77
102
|
|
|
103
|
+
setUserId(userId: string): void;
|
|
78
104
|
setMuted(muted: boolean): void;
|
|
79
|
-
|
|
80
105
|
isMuted(): Promise<boolean>;
|
|
81
|
-
|
|
82
106
|
setVerboseLogging(enabled: boolean): void;
|
|
83
|
-
|
|
84
107
|
setCreativeDebuggerEnabled(enabled: boolean): void;
|
|
85
|
-
|
|
86
108
|
setTestDeviceAdvertisingIds(ids: string[]): void;
|
|
87
109
|
|
|
88
|
-
|
|
110
|
+
// ─────────────────────────────────────────────────────────
|
|
111
|
+
// Extra Parameters
|
|
112
|
+
// ─────────────────────────────────────────────────────────
|
|
89
113
|
|
|
114
|
+
setExtraParameter(key: string, value: string | null): void;
|
|
90
115
|
setInitializationAdUnitIds(adUnitIds: string[]): void;
|
|
91
116
|
|
|
92
|
-
|
|
117
|
+
// ─────────────────────────────────────────────────────────
|
|
118
|
+
// CMP (Consent Flow)
|
|
119
|
+
// ─────────────────────────────────────────────────────────
|
|
93
120
|
|
|
121
|
+
setTermsAndPrivacyPolicyFlowEnabled(enabled: boolean): void;
|
|
94
122
|
setPrivacyPolicyUrl(url: string): void;
|
|
95
|
-
|
|
96
123
|
setTermsOfServiceUrl(url: string): void;
|
|
97
|
-
|
|
98
124
|
setConsentFlowDebugUserGeography(userGeography: string): void;
|
|
99
|
-
|
|
100
125
|
showCmpForExistingUser(): Promise<CMPError | null>;
|
|
101
|
-
|
|
102
126
|
hasSupportedCmp(): Promise<boolean>;
|
|
103
127
|
|
|
104
|
-
|
|
128
|
+
// ─────────────────────────────────────────────────────────
|
|
129
|
+
// Segments
|
|
130
|
+
// ─────────────────────────────────────────────────────────
|
|
105
131
|
|
|
132
|
+
addSegment(key: number, values: number[]): Promise<void>;
|
|
106
133
|
getSegments(): Promise<{ [key: string]: number[] } | null>;
|
|
107
134
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
135
|
+
// ─────────────────────────────────────────────────────────
|
|
136
|
+
// Banner Ads
|
|
137
|
+
// ─────────────────────────────────────────────────────────
|
|
111
138
|
|
|
139
|
+
createBanner(adUnitId: string, position: string, isAdaptive: boolean): void;
|
|
140
|
+
createBannerWithOffsets(adUnitId: string, position: string, xOffset: number, yOffset: number, isAdaptive: boolean): void;
|
|
112
141
|
setBannerBackgroundColor(adUnitId: string, hexColorCode: string): void;
|
|
113
|
-
|
|
114
142
|
setBannerPlacement(adUnitId: string, placement: string | null): void;
|
|
115
|
-
|
|
116
143
|
setBannerCustomData(adUnitId: string, customData: string | null): void;
|
|
117
|
-
|
|
118
144
|
setBannerWidth(adUnitId: string, width: number): void;
|
|
119
|
-
|
|
120
145
|
updateBannerPosition(adUnitId: string, position: string): void;
|
|
121
|
-
|
|
122
146
|
updateBannerOffsets(adUnitId: string, xOffset: number, yOffset: number): void;
|
|
123
|
-
|
|
124
147
|
setBannerExtraParameter(adUnitId: string, key: string, value: string | null): void;
|
|
125
|
-
|
|
126
148
|
setBannerLocalExtraParameter(adUnitId: string, parameters: UnsafeObject): void;
|
|
127
|
-
|
|
128
149
|
startBannerAutoRefresh(adUnitId: string): void;
|
|
129
|
-
|
|
130
150
|
stopBannerAutoRefresh(adUnitId: string): void;
|
|
131
|
-
|
|
132
151
|
showBanner(adUnitId: string): void;
|
|
133
|
-
|
|
134
152
|
hideBanner(adUnitId: string): void;
|
|
135
|
-
|
|
136
153
|
destroyBanner(adUnitId: string): void;
|
|
137
|
-
|
|
138
154
|
getAdaptiveBannerHeightForWidth(width: number): Promise<number>;
|
|
139
155
|
|
|
140
|
-
|
|
156
|
+
// ─────────────────────────────────────────────────────────
|
|
157
|
+
// MREC Ads
|
|
158
|
+
// ─────────────────────────────────────────────────────────
|
|
141
159
|
|
|
160
|
+
createMRec(adUnitId: string, position: string): void;
|
|
142
161
|
setMRecPlacement(adUnitId: string, placement: string | null): void;
|
|
143
|
-
|
|
144
162
|
setMRecCustomData(adUnitId: string, customData: string | null): void;
|
|
145
|
-
|
|
146
163
|
updateMRecPosition(adUnitId: string, position: string): void;
|
|
147
|
-
|
|
148
164
|
setMRecExtraParameter(adUnitId: string, key: string, value: string | null): void;
|
|
149
|
-
|
|
150
165
|
setMRecLocalExtraParameter(adUnitId: string, parameters: UnsafeObject): void;
|
|
151
|
-
|
|
152
166
|
startMRecAutoRefresh(adUnitId: string): void;
|
|
153
|
-
|
|
154
167
|
stopMRecAutoRefresh(adUnitId: string): void;
|
|
155
|
-
|
|
156
168
|
showMRec(adUnitId: string): void;
|
|
157
|
-
|
|
158
169
|
hideMRec(adUnitId: string): void;
|
|
159
|
-
|
|
160
170
|
destroyMRec(adUnitId: string): void;
|
|
161
171
|
|
|
162
|
-
|
|
172
|
+
// ─────────────────────────────────────────────────────────
|
|
173
|
+
// Interstitial Ads
|
|
174
|
+
// ─────────────────────────────────────────────────────────
|
|
163
175
|
|
|
176
|
+
loadInterstitial(adUnitId: string): void;
|
|
164
177
|
isInterstitialReady(adUnitId: string): Promise<boolean>;
|
|
165
|
-
|
|
166
178
|
showInterstitial(adUnitId: string, placement?: string | null, customData?: string | null): void;
|
|
167
|
-
|
|
168
179
|
setInterstitialExtraParameter(adUnitId: string, key: string, value: string | null): void;
|
|
169
|
-
|
|
170
180
|
setInterstitialLocalExtraParameter(adUnitId: string, parameters: UnsafeObject): void;
|
|
171
181
|
|
|
172
|
-
|
|
182
|
+
// ─────────────────────────────────────────────────────────
|
|
183
|
+
// Rewarded Ads
|
|
184
|
+
// ─────────────────────────────────────────────────────────
|
|
173
185
|
|
|
186
|
+
loadRewardedAd(adUnitId: string): void;
|
|
174
187
|
isRewardedAdReady(adUnitId: string): Promise<boolean>;
|
|
175
|
-
|
|
176
188
|
showRewardedAd(adUnitId: string, placement?: string | null, customData?: string | null): void;
|
|
177
|
-
|
|
178
189
|
setRewardedAdExtraParameter(adUnitId: string, key: string, value: string | null): void;
|
|
179
|
-
|
|
180
190
|
setRewardedAdLocalExtraParameter(adUnitId: string, parameters: UnsafeObject): void;
|
|
181
191
|
|
|
182
|
-
|
|
192
|
+
// ─────────────────────────────────────────────────────────
|
|
193
|
+
// App Open Ads
|
|
194
|
+
// ─────────────────────────────────────────────────────────
|
|
183
195
|
|
|
196
|
+
loadAppOpenAd(adUnitId: string): void;
|
|
184
197
|
isAppOpenAdReady(adUnitId: string): Promise<boolean>;
|
|
185
|
-
|
|
186
198
|
showAppOpenAd(adUnitId: string, placement?: string | null, customData?: string | null): void;
|
|
187
|
-
|
|
188
199
|
setAppOpenAdExtraParameter(adUnitId: string, key: string, value: string | null): void;
|
|
189
|
-
|
|
190
200
|
setAppOpenAdLocalExtraParameter(adUnitId: string, parameters: UnsafeObject): void;
|
|
191
201
|
|
|
202
|
+
// ─────────────────────────────────────────────────────────
|
|
203
|
+
// Native UI Component AdView (Preload/Destroy)
|
|
204
|
+
// ─────────────────────────────────────────────────────────
|
|
205
|
+
|
|
192
206
|
preloadNativeUIComponentAdView(
|
|
193
207
|
adUnitId: string,
|
|
194
208
|
adFormat: string,
|
|
209
|
+
isAdaptive: boolean,
|
|
195
210
|
placement?: string | null,
|
|
196
211
|
customData?: string | null,
|
|
197
212
|
extraParameters?: UnsafeObject | null,
|
|
@@ -200,9 +215,15 @@ export interface Spec extends TurboModule {
|
|
|
200
215
|
|
|
201
216
|
destroyNativeUIComponentAdView(adViewId: number): Promise<void>;
|
|
202
217
|
|
|
203
|
-
|
|
218
|
+
// ─────────────────────────────────────────────────────────
|
|
219
|
+
// TurboModule Listener Management
|
|
220
|
+
// ─────────────────────────────────────────────────────────
|
|
204
221
|
|
|
222
|
+
addListener(eventType: string): void;
|
|
205
223
|
removeListeners(count: number): void;
|
|
206
224
|
}
|
|
207
225
|
|
|
226
|
+
/**
|
|
227
|
+
* Enforces use of the native AppLovinMAX TurboModule.
|
|
228
|
+
*/
|
|
208
229
|
export default TurboModuleRegistry.getEnforcing<Spec>('AppLovinMAX');
|
package/src/types/AdEvent.ts
CHANGED
|
@@ -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
|
-
*
|
|
7
|
-
*
|
|
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
|
-
*
|
|
13
|
-
*
|
|
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 };
|