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/AppLovinMAX.ts
CHANGED
|
@@ -3,154 +3,151 @@ import type { CMPError } from './CMPError';
|
|
|
3
3
|
import type { ConsentFlowUserGeography } from '../AppLovinMAX';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Defines the AppLovin MAX module interface exposed to JavaScript.
|
|
7
7
|
*/
|
|
8
8
|
export type AppLovinMAXType = {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* Checks whether the AppLovin MAX SDK has finished initializing.
|
|
11
|
+
*
|
|
12
|
+
* @returns A promise that resolves to `true` if the SDK is initialized, or `false` otherwise.
|
|
12
13
|
*/
|
|
13
14
|
isInitialized(): Promise<boolean>;
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
|
-
* Initializes the
|
|
17
|
+
* Initializes the AppLovin MAX SDK.
|
|
17
18
|
*
|
|
18
|
-
* @param sdkKey
|
|
19
|
+
* @param sdkKey - Your AppLovin SDK key.
|
|
20
|
+
* @returns A promise that resolves with the initialization configuration.
|
|
19
21
|
*/
|
|
20
22
|
initialize(sdkKey: string): Promise<Configuration>;
|
|
21
23
|
|
|
22
24
|
/**
|
|
23
|
-
*
|
|
25
|
+
* Restricts initialization to the specified ad unit IDs only.
|
|
24
26
|
*
|
|
25
|
-
* @param adUnitIds
|
|
27
|
+
* @param adUnitIds - An array of ad unit IDs to initialize.
|
|
26
28
|
*/
|
|
27
29
|
setInitializationAdUnitIds(adUnitIds: string[]): void;
|
|
28
30
|
|
|
29
31
|
/**
|
|
30
|
-
*
|
|
32
|
+
* Displays the AppLovin Mediation Debugger UI.
|
|
31
33
|
*/
|
|
32
34
|
showMediationDebugger(): void;
|
|
33
35
|
|
|
34
36
|
/**
|
|
35
|
-
*
|
|
37
|
+
* Checks whether the current device is a tablet.
|
|
38
|
+
*
|
|
39
|
+
* @returns A promise that resolves to `true` if the device is a tablet.
|
|
36
40
|
*/
|
|
37
41
|
isTablet(): Promise<boolean>;
|
|
38
42
|
|
|
39
43
|
/**
|
|
40
|
-
* Sets
|
|
41
|
-
* optional S2S postbacks.
|
|
44
|
+
* Sets a user ID for use in SDK events and S2S postbacks.
|
|
42
45
|
*
|
|
43
|
-
* @param userId
|
|
46
|
+
* @param userId - The custom user ID to associate with this device.
|
|
44
47
|
*/
|
|
45
48
|
setUserId(userId: string): void;
|
|
46
49
|
|
|
47
50
|
/**
|
|
48
|
-
* Sets
|
|
51
|
+
* Sets whether video ads should start in a muted state.
|
|
49
52
|
*
|
|
50
|
-
* @param muted
|
|
53
|
+
* @param muted - `true` to mute ads by default.
|
|
51
54
|
*/
|
|
52
55
|
setMuted(muted: boolean): void;
|
|
53
56
|
|
|
54
57
|
/**
|
|
55
|
-
*
|
|
58
|
+
* Gets whether video ads will start muted.
|
|
59
|
+
*
|
|
60
|
+
* @returns A promise that resolves to `true` if ads will begin muted.
|
|
56
61
|
*/
|
|
57
62
|
isMuted(): Promise<boolean>;
|
|
58
63
|
|
|
59
64
|
/**
|
|
60
|
-
*
|
|
65
|
+
* Enables or disables verbose logging in the AppLovin MAX SDK.
|
|
61
66
|
*
|
|
62
|
-
* @param verboseLoggingEnabled true
|
|
67
|
+
* @param verboseLoggingEnabled - `true` to enable verbose logs.
|
|
63
68
|
*/
|
|
64
69
|
setVerboseLogging(verboseLoggingEnabled: boolean): void;
|
|
65
70
|
|
|
66
71
|
/**
|
|
67
|
-
*
|
|
68
|
-
* each test device. Refer to AppLovin logs for the IDFA or IDFV of your current device.
|
|
72
|
+
* Registers test devices using their advertising IDs (IDFA/IDFV).
|
|
69
73
|
*
|
|
70
|
-
* @param advertisingIds
|
|
74
|
+
* @param advertisingIds - An array of advertising IDs to register.
|
|
71
75
|
*/
|
|
72
76
|
setTestDeviceAdvertisingIds(advertisingIds: string[]): void;
|
|
73
77
|
|
|
74
78
|
/**
|
|
75
|
-
*
|
|
79
|
+
* Enables or disables the Creative Debugger gesture (flip screen down twice).
|
|
76
80
|
*
|
|
77
|
-
* @param enabled
|
|
81
|
+
* @param enabled - `true` to enable the Creative Debugger (default: true).
|
|
78
82
|
*/
|
|
79
83
|
setCreativeDebuggerEnabled(enabled: boolean): void;
|
|
80
84
|
|
|
81
85
|
/**
|
|
82
|
-
* Sets an extra parameter to
|
|
86
|
+
* Sets an extra parameter to send with SDK requests.
|
|
83
87
|
*
|
|
84
|
-
* @param key
|
|
85
|
-
* @param value
|
|
88
|
+
* @param key - The name of the parameter.
|
|
89
|
+
* @param value - The value of the parameter, or `null` to clear it.
|
|
86
90
|
*/
|
|
87
91
|
setExtraParameter(key: string, value: string | null): void;
|
|
88
92
|
|
|
89
93
|
/**
|
|
90
|
-
* Enables the MAX Terms and Privacy Policy
|
|
94
|
+
* Enables the AppLovin MAX Terms and Privacy Policy flow.
|
|
91
95
|
*
|
|
92
|
-
* @param enabled true to enable the
|
|
96
|
+
* @param enabled - `true` to enable the flow.
|
|
93
97
|
*/
|
|
94
98
|
setTermsAndPrivacyPolicyFlowEnabled(enabled: boolean): void;
|
|
95
99
|
|
|
96
100
|
/**
|
|
97
|
-
*
|
|
98
|
-
* the Terms Flow.
|
|
101
|
+
* Sets the URL for your company’s privacy policy (required to enable the terms flow).
|
|
99
102
|
*
|
|
100
|
-
* @param urlString
|
|
103
|
+
* @param urlString - A valid URL string to your privacy policy.
|
|
101
104
|
*/
|
|
102
105
|
setPrivacyPolicyUrl(urlString: string): void;
|
|
103
106
|
|
|
104
107
|
/**
|
|
105
|
-
*
|
|
106
|
-
* the Terms Flow with or without it.
|
|
108
|
+
* Sets the URL for your company’s terms of service (optional).
|
|
107
109
|
*
|
|
108
|
-
* @param urlString
|
|
110
|
+
* @param urlString - A valid URL string to your terms of service.
|
|
109
111
|
*/
|
|
110
112
|
setTermsOfServiceUrl(urlString: string): void;
|
|
111
113
|
|
|
112
114
|
/**
|
|
113
|
-
*
|
|
115
|
+
* Sets a mock geography for testing the CMP flow (e.g., GDPR).
|
|
114
116
|
*
|
|
115
|
-
* @note
|
|
117
|
+
* @note This only applies when running the app in debug mode.
|
|
118
|
+
*
|
|
119
|
+
* @param userGeography - The mock user geography to simulate.
|
|
116
120
|
*/
|
|
117
121
|
setConsentFlowDebugUserGeography(userGeography: ConsentFlowUserGeography): void;
|
|
118
122
|
|
|
119
123
|
/**
|
|
120
|
-
*
|
|
121
|
-
* Note that this resets the user’s existing consent information.
|
|
122
|
-
*
|
|
123
|
-
* The function returns when the flow finishes showing. On success, returns null. On failure,
|
|
124
|
-
* returns one of the {@link CMPError} codes.
|
|
124
|
+
* Displays the CMP flow for an existing user and resets their consent status.
|
|
125
125
|
*
|
|
126
|
-
* @
|
|
126
|
+
* @returns A promise that resolves to `null` on success, or a {@link CMPError} on failure.
|
|
127
127
|
*/
|
|
128
128
|
showCmpForExistingUser(): Promise<CMPError | null>;
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
|
-
*
|
|
131
|
+
* Checks if a supported CMP SDK is available.
|
|
132
132
|
*
|
|
133
|
-
* @
|
|
133
|
+
* @returns A promise that resolves to `true` if a CMP is detected.
|
|
134
134
|
*/
|
|
135
135
|
hasSupportedCmp(): Promise<boolean>;
|
|
136
136
|
|
|
137
137
|
/**
|
|
138
|
-
* Adds a
|
|
138
|
+
* Adds a new user segment.
|
|
139
139
|
*
|
|
140
|
-
* @param key An integer key.
|
|
141
|
-
* @param values An array of
|
|
142
|
-
* @returns A promise that resolves
|
|
143
|
-
* void.
|
|
144
|
-
* @throws Throws an error if the segments can not be added.
|
|
140
|
+
* @param key - An integer key identifying the segment.
|
|
141
|
+
* @param values - An array of integer values for the segment.
|
|
142
|
+
* @returns A promise that resolves on success, or rejects if the operation fails.
|
|
145
143
|
*/
|
|
146
144
|
addSegment(key: number, values: number[]): Promise<void>;
|
|
147
145
|
|
|
148
146
|
/**
|
|
149
|
-
*
|
|
147
|
+
* Retrieves the list of user segments.
|
|
150
148
|
*
|
|
151
|
-
* @returns A promise that resolves
|
|
152
|
-
*
|
|
153
|
-
* @throws Throws an error if the segments can not be gotten.
|
|
149
|
+
* @returns A promise that resolves to a map of segment keys to arrays of values,
|
|
150
|
+
* or `null` if no segments are available.
|
|
154
151
|
*/
|
|
155
152
|
getSegments(): Promise<Map<number, number[]> | null>;
|
|
156
153
|
};
|
package/src/types/BannerAd.ts
CHANGED
|
@@ -1,46 +1,52 @@
|
|
|
1
1
|
import type { ViewAdType } from './ViewAd';
|
|
2
2
|
import type { AdViewPosition } from '../AdView';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Defines the interface for managing banner ads.
|
|
6
|
+
* Extends {@link ViewAdType} with banner-specific layout and customization methods.
|
|
7
|
+
*/
|
|
4
8
|
export type BannerAdType = ViewAdType & {
|
|
5
9
|
/**
|
|
6
|
-
* Creates a banner at the specified position and offsets.
|
|
10
|
+
* Creates a banner ad at the specified position and optional pixel offsets.
|
|
7
11
|
*
|
|
8
|
-
* @param adUnitId The
|
|
9
|
-
* @param position
|
|
10
|
-
* @param xOffset
|
|
11
|
-
* @param yOffset
|
|
12
|
+
* @param adUnitId - The ad unit ID to load ads for.
|
|
13
|
+
* @param position - The position of the banner on screen.
|
|
14
|
+
* @param xOffset - Optional horizontal offset from the left (default: 0).
|
|
15
|
+
* @param yOffset - Optional vertical offset from the top (default: 0).
|
|
16
|
+
* @param isAdaptive - Optional flag to enable adaptive banners (default: true).
|
|
12
17
|
*/
|
|
13
|
-
createAd(adUnitId: string, position: AdViewPosition, xOffset?: number, yOffset?: number): void;
|
|
18
|
+
createAd(adUnitId: string, position: AdViewPosition, xOffset?: number, yOffset?: number, isAdaptive?: boolean): void;
|
|
14
19
|
|
|
15
20
|
/**
|
|
16
|
-
* Sets
|
|
21
|
+
* Sets the background color of the banner.
|
|
17
22
|
*
|
|
18
|
-
* @param adUnitId The
|
|
19
|
-
* @param hexColorCode
|
|
23
|
+
* @param adUnitId - The ad unit ID of the banner.
|
|
24
|
+
* @param hexColorCode - A hex color string (e.g. "#FFFFFF").
|
|
20
25
|
*/
|
|
21
26
|
setBackgroundColor(adUnitId: string, hexColorCode: string): void;
|
|
22
27
|
|
|
23
28
|
/**
|
|
24
|
-
* Sets the banner
|
|
29
|
+
* Sets the width of the banner.
|
|
25
30
|
*
|
|
26
|
-
* @param adUnitId The
|
|
27
|
-
* @param width
|
|
31
|
+
* @param adUnitId - The ad unit ID of the banner.
|
|
32
|
+
* @param width - Desired width in pixels.
|
|
28
33
|
*/
|
|
29
34
|
setWidth(adUnitId: string, width: number): void;
|
|
30
35
|
|
|
31
36
|
/**
|
|
32
|
-
* Updates the banner
|
|
37
|
+
* Updates the position offsets of the banner after creation.
|
|
33
38
|
*
|
|
34
|
-
* @param adUnitId The
|
|
35
|
-
* @param xOffset Horizontal offset from the left
|
|
36
|
-
* @param yOffset Vertical offset from the top
|
|
39
|
+
* @param adUnitId - The ad unit ID of the banner.
|
|
40
|
+
* @param xOffset - Horizontal offset from the left.
|
|
41
|
+
* @param yOffset - Vertical offset from the top.
|
|
37
42
|
*/
|
|
38
43
|
updateOffsets(adUnitId: string, xOffset: number, yOffset: number): void;
|
|
39
44
|
|
|
40
45
|
/**
|
|
41
|
-
*
|
|
46
|
+
* Calculates the adaptive banner height for the given width and current screen orientation.
|
|
42
47
|
*
|
|
43
|
-
* @param width The banner width.
|
|
48
|
+
* @param width - The banner width in pixels.
|
|
49
|
+
* @returns A promise that resolves with the appropriate height.
|
|
44
50
|
*/
|
|
45
51
|
getAdaptiveHeightForWidth(width: number): Promise<number>;
|
|
46
52
|
};
|
package/src/types/CMPError.ts
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
import type { CMPErrorCode } from '../AppLovinMAX';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Represents an error returned from the Consent Management Platform (CMP) flow.
|
|
5
|
+
*/
|
|
3
6
|
export type CMPError = {
|
|
4
7
|
/**
|
|
5
|
-
* The error code
|
|
8
|
+
* The AppLovin-defined CMP error code.
|
|
6
9
|
*/
|
|
7
10
|
code: CMPErrorCode;
|
|
8
11
|
|
|
9
12
|
/**
|
|
10
|
-
*
|
|
13
|
+
* A descriptive error message from the AppLovin SDK.
|
|
11
14
|
*/
|
|
12
15
|
message: string;
|
|
13
16
|
|
|
14
17
|
/**
|
|
15
|
-
* The error code returned by the CMP.
|
|
18
|
+
* The raw error code returned by the CMP.
|
|
16
19
|
*/
|
|
17
20
|
cmpCode: number;
|
|
18
21
|
|
|
19
22
|
/**
|
|
20
|
-
* The error message returned by the CMP.
|
|
23
|
+
* The raw error message returned by the CMP.
|
|
21
24
|
*/
|
|
22
25
|
cmpMessage: string;
|
|
23
26
|
};
|
|
@@ -1,36 +1,34 @@
|
|
|
1
1
|
import type { ConsentFlowUserGeography, AppTrackingStatus } from '../AppLovinMAX';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Represents the AppLovin MAX SDK configuration returned after initialization.
|
|
5
5
|
*/
|
|
6
6
|
export type Configuration = {
|
|
7
7
|
/**
|
|
8
|
-
* The country code
|
|
8
|
+
* The user's country code.
|
|
9
9
|
*/
|
|
10
10
|
countryCode: string;
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* The user's
|
|
14
|
-
*
|
|
13
|
+
* The user's geographic region used to determine which consent flow to display.
|
|
14
|
+
* Returns {@link ConsentFlowUserGeography.UNKNOWN} if the geography cannot be determined.
|
|
15
15
|
*/
|
|
16
16
|
consentFlowUserGeography: ConsentFlowUserGeography;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* Note: available only on iOS
|
|
19
|
+
* The user's app tracking transparency status on iOS.
|
|
20
|
+
* Only available on iOS 14+; undefined on Android.
|
|
23
21
|
*/
|
|
24
22
|
appTrackingStatus?: AppTrackingStatus;
|
|
25
23
|
|
|
26
24
|
/**
|
|
27
|
-
*
|
|
25
|
+
* Indicates whether test mode is enabled for this session.
|
|
28
26
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
27
|
+
* Returns `true` if any of the following conditions are met:
|
|
28
|
+
* - {@link AppLovinMAX.setTestDeviceAdvertisingIds()} was called with the current device's GAID before SDK initialization.
|
|
29
|
+
* - The current device was registered via the MAX dashboard under "Test Devices".
|
|
30
|
+
* - Test mode was manually enabled in the Mediation Debugger in a previous session.
|
|
31
|
+
* - The app is running on an emulator.
|
|
34
32
|
*/
|
|
35
33
|
isTestModeEnabled: boolean;
|
|
36
34
|
};
|
|
@@ -3,139 +3,132 @@ import type { AdInfo, AdLoadFailedInfo, AdDisplayFailedInfo } from './AdInfo';
|
|
|
3
3
|
import type { LocalExtraParameterValue } from './AdProps';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Defines
|
|
6
|
+
* Defines the interface for managing full-screen ads such as Interstitial, Rewarded, and AppOpen ads.
|
|
7
7
|
*/
|
|
8
8
|
export type FullscreenAdType = {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Checks whether an ad is ready to be shown.
|
|
11
11
|
*
|
|
12
|
-
* @param adUnitId The ad unit ID
|
|
12
|
+
* @param adUnitId - The ad unit ID to check.
|
|
13
|
+
* @returns A promise that resolves to `true` if the ad is ready.
|
|
13
14
|
*/
|
|
14
15
|
isAdReady(adUnitId: string): Promise<boolean>;
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
|
-
* Loads
|
|
18
|
+
* Loads a full-screen ad for the given ad unit ID.
|
|
18
19
|
*
|
|
19
|
-
* @param adUnitId The ad unit ID to load
|
|
20
|
+
* @param adUnitId - The ad unit ID to load.
|
|
20
21
|
*/
|
|
21
22
|
loadAd(adUnitId: string): void;
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
|
-
* Shows
|
|
25
|
-
* events to.
|
|
25
|
+
* Shows a loaded full-screen ad.
|
|
26
26
|
*
|
|
27
|
-
* @param adUnitId The ad unit ID of the ad to show.
|
|
28
|
-
* @param placement
|
|
29
|
-
* @param customData
|
|
27
|
+
* @param adUnitId - The ad unit ID of the ad to show.
|
|
28
|
+
* @param placement - Optional placement name for event reporting.
|
|
29
|
+
* @param customData - Optional custom string data (max size: 8 KB).
|
|
30
30
|
*/
|
|
31
31
|
showAd(adUnitId: string, placement?: string | null, customData?: string | null): void;
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
* Sets an extra
|
|
34
|
+
* Sets an extra parameter to pass to the SDK for the specified ad unit.
|
|
35
35
|
*
|
|
36
|
-
* @param adUnitId The ad unit ID
|
|
37
|
-
* @param key
|
|
38
|
-
* @param value
|
|
36
|
+
* @param adUnitId - The ad unit ID.
|
|
37
|
+
* @param key - The parameter name.
|
|
38
|
+
* @param value - The parameter value or `null` to clear it.
|
|
39
39
|
*/
|
|
40
40
|
setExtraParameter(adUnitId: string, key: string, value: string | null): void;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
* Sets a local extra parameter to pass to the adapter
|
|
43
|
+
* Sets a local extra parameter to pass to the adapter for the specified ad unit.
|
|
44
44
|
*
|
|
45
|
-
* @param adUnitId The ad unit ID
|
|
46
|
-
* @param key
|
|
47
|
-
* @param value
|
|
45
|
+
* @param adUnitId - The ad unit ID.
|
|
46
|
+
* @param key - The parameter name.
|
|
47
|
+
* @param value - The parameter value (string, number, boolean, object, or null).
|
|
48
48
|
*/
|
|
49
49
|
setLocalExtraParameter(adUnitId: string, key: string, value: LocalExtraParameterValue): void;
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* Registers a listener for when an ad is successfully loaded.
|
|
53
53
|
*
|
|
54
|
-
* @param listener
|
|
54
|
+
* @param listener - Callback to be notified with {@link AdInfo}.
|
|
55
55
|
*/
|
|
56
56
|
addAdLoadedEventListener(listener: AdEventListener<AdInfo>): void;
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
59
|
+
* Unregisters the ad loaded listener.
|
|
60
60
|
*/
|
|
61
61
|
removeAdLoadedEventListener(): void;
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
|
-
*
|
|
65
|
-
* could not load a new ad.
|
|
64
|
+
* Registers a listener for when an ad fails to load.
|
|
66
65
|
*
|
|
67
|
-
* @param listener
|
|
66
|
+
* @param listener - Callback to be notified with {@link AdLoadFailedInfo}.
|
|
68
67
|
*/
|
|
69
68
|
addAdLoadFailedEventListener(listener: AdEventListener<AdLoadFailedInfo>): void;
|
|
70
69
|
|
|
71
70
|
/**
|
|
72
|
-
*
|
|
73
|
-
* not load a new ad.
|
|
71
|
+
* Unregisters the ad load failure listener.
|
|
74
72
|
*/
|
|
75
73
|
removeAdLoadFailedEventListener(): void;
|
|
76
74
|
|
|
77
75
|
/**
|
|
78
|
-
*
|
|
76
|
+
* Registers a listener for ad click events.
|
|
79
77
|
*
|
|
80
|
-
* @param listener
|
|
78
|
+
* @param listener - Callback to be notified with {@link AdInfo}.
|
|
81
79
|
*/
|
|
82
80
|
addAdClickedEventListener(listener: AdEventListener<AdInfo>): void;
|
|
83
81
|
|
|
84
82
|
/**
|
|
85
|
-
*
|
|
83
|
+
* Unregisters the ad click listener.
|
|
86
84
|
*/
|
|
87
85
|
removeAdClickedEventListener(): void;
|
|
88
86
|
|
|
89
87
|
/**
|
|
90
|
-
*
|
|
88
|
+
* Registers a listener for when an ad is displayed.
|
|
91
89
|
*
|
|
92
|
-
* @param listener
|
|
90
|
+
* @param listener - Callback to be notified with {@link AdInfo}.
|
|
93
91
|
*/
|
|
94
92
|
addAdDisplayedEventListener(listener: AdEventListener<AdInfo>): void;
|
|
95
93
|
|
|
96
94
|
/**
|
|
97
|
-
*
|
|
95
|
+
* Unregisters the ad display listener.
|
|
98
96
|
*/
|
|
99
97
|
removeAdDisplayedEventListener(): void;
|
|
100
98
|
|
|
101
99
|
/**
|
|
102
|
-
*
|
|
103
|
-
* ad fails to display the ad.
|
|
100
|
+
* Registers a listener for when an ad fails to display.
|
|
104
101
|
*
|
|
105
|
-
* @param listener
|
|
102
|
+
* @param listener - Callback to be notified with {@link AdDisplayFailedInfo}.
|
|
106
103
|
*/
|
|
107
104
|
addAdFailedToDisplayEventListener(listener: AdEventListener<AdDisplayFailedInfo>): void;
|
|
108
105
|
|
|
109
106
|
/**
|
|
110
|
-
*
|
|
111
|
-
* fails to display the ad.
|
|
107
|
+
* Unregisters the ad display failure listener.
|
|
112
108
|
*/
|
|
113
109
|
removeAdFailedToDisplayEventListener(): void;
|
|
114
110
|
|
|
115
111
|
/**
|
|
116
|
-
*
|
|
117
|
-
* ad.
|
|
112
|
+
* Registers a listener for when an ad is hidden (dismissed).
|
|
118
113
|
*
|
|
119
|
-
* @param listener
|
|
114
|
+
* @param listener - Callback to be notified with {@link AdInfo}.
|
|
120
115
|
*/
|
|
121
116
|
addAdHiddenEventListener(listener: AdEventListener<AdInfo>): void;
|
|
122
117
|
|
|
123
118
|
/**
|
|
124
|
-
*
|
|
119
|
+
* Unregisters the ad hidden listener.
|
|
125
120
|
*/
|
|
126
121
|
removeAdHiddenEventListener(): void;
|
|
127
122
|
|
|
128
123
|
/**
|
|
129
|
-
*
|
|
130
|
-
* pays ad revenue to the publisher.
|
|
124
|
+
* Registers a listener for when ad revenue is paid.
|
|
131
125
|
*
|
|
132
|
-
* @param listener
|
|
126
|
+
* @param listener - Callback to be notified with {@link AdInfo}.
|
|
133
127
|
*/
|
|
134
128
|
addAdRevenuePaidListener(listener: AdEventListener<AdInfo>): void;
|
|
135
129
|
|
|
136
130
|
/**
|
|
137
|
-
*
|
|
138
|
-
* ad revenue to the publisher.
|
|
131
|
+
* Unregisters the ad revenue paid listener.
|
|
139
132
|
*/
|
|
140
133
|
removeAdRevenuePaidListener(): void;
|
|
141
134
|
};
|
package/src/types/MRecAd.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import type { ViewAdType } from './ViewAd';
|
|
2
2
|
import type { AdViewPosition } from '../AdView';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Defines the interface for managing MREC ads.
|
|
6
|
+
* Extends {@link ViewAdType} with MREC-specific creation logic.
|
|
7
|
+
*/
|
|
4
8
|
export type MRecAdType = ViewAdType & {
|
|
5
9
|
/**
|
|
6
|
-
* Creates
|
|
10
|
+
* Creates an MREC ad at the specified screen position.
|
|
7
11
|
*
|
|
8
|
-
* @param adUnitId The
|
|
9
|
-
* @param position {@link AdViewPosition}
|
|
12
|
+
* @param adUnitId - The ad unit ID to load the ad for.
|
|
13
|
+
* @param position - The desired position for the MREC, defined by {@link AdViewPosition}.
|
|
10
14
|
*/
|
|
11
15
|
createAd(adUnitId: string, position: AdViewPosition): void;
|
|
12
16
|
};
|
package/src/types/NativeAd.ts
CHANGED
|
@@ -1,54 +1,55 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Represents a native ad
|
|
2
|
+
* Represents the structure of a native ad used internally by {@link NativeAdView}.
|
|
3
|
+
* This type is intended for internal use only.
|
|
3
4
|
*/
|
|
4
5
|
export type NativeAd = {
|
|
5
6
|
/**
|
|
6
|
-
* The
|
|
7
|
+
* The ad title text.
|
|
7
8
|
*/
|
|
8
9
|
title?: string | null;
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
|
-
* The
|
|
12
|
+
* The advertiser name.
|
|
12
13
|
*/
|
|
13
14
|
advertiser?: string | null;
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
|
-
* The
|
|
17
|
+
* The ad body text.
|
|
17
18
|
*/
|
|
18
19
|
body?: string | null;
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
|
-
* The
|
|
22
|
+
* The call-to-action text.
|
|
22
23
|
*/
|
|
23
24
|
callToAction?: string | null;
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
|
-
*
|
|
27
|
+
* Indicates whether an icon image is available.
|
|
27
28
|
*/
|
|
28
29
|
image?: boolean;
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
|
-
* The
|
|
32
|
+
* The base64-encoded image source for the icon (if provided inline).
|
|
32
33
|
*/
|
|
33
34
|
imageSource?: string | null;
|
|
34
35
|
|
|
35
36
|
/**
|
|
36
|
-
* The URL
|
|
37
|
+
* The URL of the icon image.
|
|
37
38
|
*/
|
|
38
39
|
url?: string;
|
|
39
40
|
|
|
40
41
|
/**
|
|
41
|
-
* The star rating of the
|
|
42
|
+
* The star rating of the ad, typically in the range [0.0 – 5.0].
|
|
42
43
|
*/
|
|
43
44
|
starRating?: number;
|
|
44
45
|
|
|
45
46
|
/**
|
|
46
|
-
* Whether
|
|
47
|
+
* Whether the native Options view is available.
|
|
47
48
|
*/
|
|
48
49
|
isOptionsViewAvailable: boolean;
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
|
-
* Whether
|
|
52
|
+
* Whether the native Media view (video or image) is available.
|
|
52
53
|
*/
|
|
53
54
|
isMediaViewAvailable: boolean;
|
|
54
55
|
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import type { AdProps } from './AdProps';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* A handler
|
|
4
|
+
* A reference handler for the {@link NativeAdView} component.
|
|
5
5
|
*/
|
|
6
6
|
export type NativeAdViewHandler = {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Triggers a native ad load.
|
|
9
9
|
*/
|
|
10
10
|
loadAd(): void;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Props passed to the {@link NativeAdView} component.
|
|
15
|
+
* Extends the base {@link AdProps} used for all ad components.
|
|
15
16
|
*/
|
|
16
17
|
export type NativeAdViewProps = AdProps;
|