react-native-applovin-max 9.0.0 → 9.1.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 +1 -1
- package/android/src/main/java/com/applovin/reactnative/AppLovinMAXModuleImpl.java +2 -1
- package/ios/AppLovinMAX.mm +2 -1
- package/lib/commonjs/AdView.js +60 -76
- 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/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/nativeAd/NativeAdView.js +33 -22
- package/lib/commonjs/nativeAd/NativeAdView.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdViewComponents.js +84 -41
- package/lib/commonjs/nativeAd/NativeAdViewComponents.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdViewProvider.js +29 -0
- 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 +60 -76
- 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/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/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 +10 -0
- 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 +28 -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 +22 -17
- 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 +62 -80
- package/src/AppLovinMAX.ts +39 -29
- 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 +75 -55
- 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 +28 -29
- package/src/types/AppLovinMAX.ts +50 -53
- package/src/types/BannerAd.ts +22 -17
- 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,15 +1,16 @@
|
|
|
1
1
|
import type { AdProps } from './AdProps';
|
|
2
2
|
/**
|
|
3
|
-
* A handler
|
|
3
|
+
* A reference handler for the {@link NativeAdView} component.
|
|
4
4
|
*/
|
|
5
5
|
export type NativeAdViewHandler = {
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Triggers a native ad load.
|
|
8
8
|
*/
|
|
9
9
|
loadAd(): void;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Props passed to the {@link NativeAdView} component.
|
|
13
|
+
* Extends the base {@link AdProps} used for all ad components.
|
|
13
14
|
*/
|
|
14
15
|
export type NativeAdViewProps = AdProps;
|
|
15
16
|
//# sourceMappingURL=NativeAdViewProps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeAdViewProps.d.ts","sourceRoot":"","sources":["../../../../src/types/NativeAdViewProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAC9B;;OAEG;IACH,MAAM,IAAI,IAAI,CAAC;CAClB,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"NativeAdViewProps.d.ts","sourceRoot":"","sources":["../../../../src/types/NativeAdViewProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAC9B;;OAEG;IACH,MAAM,IAAI,IAAI,CAAC;CAClB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC"}
|
|
@@ -1,22 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provides methods to manage user privacy settings for AppLovin MAX.
|
|
3
|
+
*/
|
|
1
4
|
export type PrivacyType = {
|
|
2
5
|
/**
|
|
3
|
-
* Sets whether
|
|
6
|
+
* Sets whether the user has granted consent for data collection and sharing.
|
|
4
7
|
*
|
|
5
|
-
* @param hasUserConsent true if the user provided consent
|
|
8
|
+
* @param hasUserConsent - `true` if the user has provided consent.
|
|
6
9
|
*/
|
|
7
10
|
setHasUserConsent(hasUserConsent: boolean): void;
|
|
8
11
|
/**
|
|
9
|
-
* Checks
|
|
12
|
+
* Checks whether the user has granted consent for information sharing.
|
|
13
|
+
*
|
|
14
|
+
* @returns A promise that resolves to `true` if the user has granted consent.
|
|
10
15
|
*/
|
|
11
16
|
hasUserConsent(): Promise<boolean>;
|
|
12
17
|
/**
|
|
13
|
-
* Sets whether
|
|
18
|
+
* Sets whether the user has opted out of the sale of their personal information.
|
|
14
19
|
*
|
|
15
|
-
* @param doNotSell true if the user opted out of
|
|
20
|
+
* @param doNotSell - `true` if the user opted out of personal data sale.
|
|
16
21
|
*/
|
|
17
22
|
setDoNotSell(doNotSell: boolean): void;
|
|
18
23
|
/**
|
|
19
|
-
* Checks
|
|
24
|
+
* Checks whether the user has opted out of the sale of their personal information.
|
|
25
|
+
*
|
|
26
|
+
* @returns A promise that resolves to `true` if the user has opted out.
|
|
20
27
|
*/
|
|
21
28
|
isDoNotSell(): Promise<boolean>;
|
|
22
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Privacy.d.ts","sourceRoot":"","sources":["../../../../src/types/Privacy.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACtB;;;;OAIG;IACH,iBAAiB,CAAC,cAAc,EAAE,OAAO,GAAG,IAAI,CAAC;IAEjD
|
|
1
|
+
{"version":3,"file":"Privacy.d.ts","sourceRoot":"","sources":["../../../../src/types/Privacy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACtB;;;;OAIG;IACH,iBAAiB,CAAC,cAAc,EAAE,OAAO,GAAG,IAAI,CAAC;IAEjD;;;;OAIG;IACH,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAEnC;;;;OAIG;IACH,YAAY,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IAEvC;;;;OAIG;IACH,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CACnC,CAAC"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import type { AdEventListener } from './AdEvent';
|
|
2
2
|
import type { AdRewardInfo } from './AdInfo';
|
|
3
3
|
import type { FullscreenAdType } from './FullscreenAd';
|
|
4
|
+
/**
|
|
5
|
+
* Defines the interface for managing rewarded ads.
|
|
6
|
+
* Extends {@link FullscreenAdType} with reward-specific callbacks.
|
|
7
|
+
*/
|
|
4
8
|
export type RewardedAdType = FullscreenAdType & {
|
|
5
9
|
/**
|
|
6
|
-
*
|
|
7
|
-
* rewards the user.
|
|
10
|
+
* Registers a listener for when a reward is granted to the user.
|
|
8
11
|
*
|
|
9
|
-
* @param listener
|
|
12
|
+
* @param listener - Callback to be notified with {@link AdRewardInfo}.
|
|
10
13
|
*/
|
|
11
14
|
addAdReceivedRewardEventListener(listener: AdEventListener<AdRewardInfo>): void;
|
|
12
15
|
/**
|
|
13
|
-
*
|
|
14
|
-
* the user.
|
|
16
|
+
* Unregisters the reward event listener.
|
|
15
17
|
*/
|
|
16
18
|
removeAdReceivedRewardEventListener(): void;
|
|
17
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RewardedAd.d.ts","sourceRoot":"","sources":["../../../../src/types/RewardedAd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,MAAM,MAAM,cAAc,GAAG,gBAAgB,GAAG;IAC5C
|
|
1
|
+
{"version":3,"file":"RewardedAd.d.ts","sourceRoot":"","sources":["../../../../src/types/RewardedAd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,gBAAgB,GAAG;IAC5C;;;;OAIG;IACH,gCAAgC,CAAC,QAAQ,EAAE,eAAe,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;IAEhF;;OAEG;IACH,mCAAmC,IAAI,IAAI,CAAC;CAC/C,CAAC"}
|
|
@@ -3,138 +3,134 @@ import type { AdInfo, AdLoadFailedInfo } from './AdInfo';
|
|
|
3
3
|
import type { LocalExtraParameterValue } from './AdProps';
|
|
4
4
|
import type { AdViewPosition } from '../AdView';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Defines the interface for view-based ads such as Banners and MRECs.
|
|
7
7
|
*/
|
|
8
8
|
export type ViewAdType = {
|
|
9
9
|
/**
|
|
10
|
-
* Destroys the banner
|
|
10
|
+
* Destroys the banner or MREC ad.
|
|
11
11
|
*
|
|
12
|
-
* @param adUnitId The ad unit ID of the ad to destroy.
|
|
12
|
+
* @param adUnitId - The ad unit ID of the ad to destroy.
|
|
13
13
|
*/
|
|
14
14
|
destroyAd(adUnitId: string): void;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Displays the banner or MREC ad.
|
|
17
17
|
*
|
|
18
|
-
* @param adUnitId The ad unit ID of the ad to show.
|
|
18
|
+
* @param adUnitId - The ad unit ID of the ad to show.
|
|
19
19
|
*/
|
|
20
20
|
showAd(adUnitId: string): void;
|
|
21
21
|
/**
|
|
22
|
-
* Hides the banner
|
|
22
|
+
* Hides the banner or MREC ad.
|
|
23
23
|
*
|
|
24
|
-
* @param adUnitId The ad unit ID of the ad to hide.
|
|
24
|
+
* @param adUnitId - The ad unit ID of the ad to hide.
|
|
25
25
|
*/
|
|
26
26
|
hideAd(adUnitId: string): void;
|
|
27
27
|
/**
|
|
28
|
-
* Sets a placement to
|
|
28
|
+
* Sets a placement to associate with the showing ad’s events.
|
|
29
29
|
*
|
|
30
|
-
* @param adUnitId The ad unit ID
|
|
31
|
-
* @param placement The placement
|
|
30
|
+
* @param adUnitId - The ad unit ID.
|
|
31
|
+
* @param placement - The placement name.
|
|
32
32
|
*/
|
|
33
33
|
setPlacement(adUnitId: string, placement: string | null): void;
|
|
34
34
|
/**
|
|
35
|
-
* Sets custom data to
|
|
35
|
+
* Sets custom data to associate with the showing ad’s events.
|
|
36
36
|
*
|
|
37
|
-
* @param adUnitId The ad unit ID
|
|
38
|
-
* @param customData
|
|
37
|
+
* @param adUnitId - The ad unit ID.
|
|
38
|
+
* @param customData - Optional custom string (max 8 KB).
|
|
39
39
|
*/
|
|
40
40
|
setCustomData(adUnitId: string, customData: string | null): void;
|
|
41
41
|
/**
|
|
42
|
-
* Updates the banner
|
|
42
|
+
* Updates the position of the banner or MREC.
|
|
43
43
|
*
|
|
44
|
-
* @param adUnitId The ad unit ID
|
|
45
|
-
* @param bannerPosition
|
|
44
|
+
* @param adUnitId - The ad unit ID.
|
|
45
|
+
* @param bannerPosition - The new position on screen.
|
|
46
46
|
*/
|
|
47
47
|
updatePosition(adUnitId: string, bannerPosition: AdViewPosition): void;
|
|
48
48
|
/**
|
|
49
|
-
* Sets an extra
|
|
49
|
+
* Sets an extra parameter for the ad.
|
|
50
50
|
*
|
|
51
|
-
* @param adUnitId The ad unit ID
|
|
52
|
-
* @param key
|
|
53
|
-
* @param value
|
|
51
|
+
* @param adUnitId - The ad unit ID.
|
|
52
|
+
* @param key - Parameter name.
|
|
53
|
+
* @param value - Parameter value (or `null` to clear it).
|
|
54
54
|
*/
|
|
55
55
|
setExtraParameter(adUnitId: string, key: string, value: string | null): void;
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
57
|
+
* Sets a local extra parameter to be passed to the mediation adapter.
|
|
58
58
|
*
|
|
59
|
-
* @param adUnitId The ad unit ID
|
|
60
|
-
* @param key
|
|
61
|
-
* @param value
|
|
59
|
+
* @param adUnitId - The ad unit ID.
|
|
60
|
+
* @param key - Parameter name.
|
|
61
|
+
* @param value - Parameter value (string, number, boolean, object, or null).
|
|
62
62
|
*/
|
|
63
63
|
setLocalExtraParameter(adUnitId: string, key: string, value: LocalExtraParameterValue): void;
|
|
64
64
|
/**
|
|
65
|
-
* Starts or resumes auto-
|
|
65
|
+
* Starts or resumes auto-refresh for the ad.
|
|
66
66
|
*
|
|
67
|
-
* @param adUnitId The ad unit ID
|
|
67
|
+
* @param adUnitId - The ad unit ID.
|
|
68
68
|
*/
|
|
69
69
|
startAutoRefresh(adUnitId: string): void;
|
|
70
70
|
/**
|
|
71
|
-
* Pauses auto-
|
|
71
|
+
* Pauses auto-refresh for the ad.
|
|
72
72
|
*
|
|
73
|
-
* @param adUnitId The ad unit ID
|
|
73
|
+
* @param adUnitId - The ad unit ID.
|
|
74
74
|
*/
|
|
75
75
|
stopAutoRefresh(adUnitId: string): void;
|
|
76
76
|
/**
|
|
77
|
-
*
|
|
77
|
+
* Registers a listener for when a new ad is successfully loaded.
|
|
78
78
|
*
|
|
79
|
-
* @param listener
|
|
79
|
+
* @param listener - Callback to be notified with {@link AdInfo}.
|
|
80
80
|
*/
|
|
81
81
|
addAdLoadedEventListener(listener: AdEventListener<AdInfo>): void;
|
|
82
82
|
/**
|
|
83
|
-
*
|
|
83
|
+
* Unregisters the ad loaded listener.
|
|
84
84
|
*/
|
|
85
85
|
removeAdLoadedEventListener(): void;
|
|
86
86
|
/**
|
|
87
|
-
*
|
|
88
|
-
* could not load a new ad.
|
|
87
|
+
* Registers a listener for when ad loading fails.
|
|
89
88
|
*
|
|
90
|
-
* @param listener
|
|
89
|
+
* @param listener - Callback to be notified with {@link AdLoadFailedInfo}.
|
|
91
90
|
*/
|
|
92
91
|
addAdLoadFailedEventListener(listener: AdEventListener<AdLoadFailedInfo>): void;
|
|
93
92
|
/**
|
|
94
|
-
*
|
|
95
|
-
* load a new ad.
|
|
93
|
+
* Unregisters the ad load failure listener.
|
|
96
94
|
*/
|
|
97
95
|
removeAdLoadFailedEventListener(): void;
|
|
98
96
|
/**
|
|
99
|
-
*
|
|
97
|
+
* Registers a listener for ad click events.
|
|
100
98
|
*
|
|
101
|
-
* @param listener
|
|
99
|
+
* @param listener - Callback to be notified with {@link AdInfo}.
|
|
102
100
|
*/
|
|
103
101
|
addAdClickedEventListener(listener: AdEventListener<AdInfo>): void;
|
|
104
102
|
/**
|
|
105
|
-
*
|
|
103
|
+
* Unregisters the ad click listener.
|
|
106
104
|
*/
|
|
107
105
|
removeAdClickedEventListener(): void;
|
|
108
106
|
/**
|
|
109
|
-
*
|
|
107
|
+
* Registers a listener for when the ad collapses (e.g. after expansion).
|
|
110
108
|
*
|
|
111
|
-
* @param listener
|
|
109
|
+
* @param listener - Callback to be notified with {@link AdInfo}.
|
|
112
110
|
*/
|
|
113
111
|
addAdCollapsedEventListener(listener: AdEventListener<AdInfo>): void;
|
|
114
112
|
/**
|
|
115
|
-
*
|
|
113
|
+
* Unregisters the ad collapsed listener.
|
|
116
114
|
*/
|
|
117
115
|
removeAdCollapsedEventListener(): void;
|
|
118
116
|
/**
|
|
119
|
-
*
|
|
117
|
+
* Registers a listener for when the ad expands.
|
|
120
118
|
*
|
|
121
|
-
* @param listener
|
|
119
|
+
* @param listener - Callback to be notified with {@link AdInfo}.
|
|
122
120
|
*/
|
|
123
121
|
addAdExpandedEventListener(listener: AdEventListener<AdInfo>): void;
|
|
124
122
|
/**
|
|
125
|
-
*
|
|
123
|
+
* Unregisters the ad expanded listener.
|
|
126
124
|
*/
|
|
127
125
|
removeAdExpandedEventListener(): void;
|
|
128
126
|
/**
|
|
129
|
-
*
|
|
130
|
-
* ad revenue to the publisher.
|
|
127
|
+
* Registers a listener for when the ad pays revenue to the publisher.
|
|
131
128
|
*
|
|
132
|
-
* @param listener
|
|
129
|
+
* @param listener - Callback to be notified with {@link AdInfo}.
|
|
133
130
|
*/
|
|
134
131
|
addAdRevenuePaidListener(listener: AdEventListener<AdInfo>): void;
|
|
135
132
|
/**
|
|
136
|
-
*
|
|
137
|
-
* revenue to the publisher.
|
|
133
|
+
* Unregisters the ad revenue paid listener.
|
|
138
134
|
*/
|
|
139
135
|
removeAdRevenuePaidListener(): void;
|
|
140
136
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewAd.d.ts","sourceRoot":"","sources":["../../../../src/types/ViewAd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACrB;;;;OAIG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAElC;;;;OAIG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B;;;;OAIG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B;;;;;OAKG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAE/D;;;;;OAKG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAEjE;;;;;OAKG;IACH,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IAEvE;;;;;;OAMG;IACH,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAE7E;;;;;;OAMG;IACH,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAE7F;;;;OAIG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzC;;;;OAIG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAExC;;;;OAIG;IACH,wBAAwB,CAAC,QAAQ,EAAE,eAAe,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAElE;;OAEG;IACH,2BAA2B,IAAI,IAAI,CAAC;IAEpC
|
|
1
|
+
{"version":3,"file":"ViewAd.d.ts","sourceRoot":"","sources":["../../../../src/types/ViewAd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACrB;;;;OAIG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAElC;;;;OAIG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B;;;;OAIG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B;;;;;OAKG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAE/D;;;;;OAKG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAEjE;;;;;OAKG;IACH,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IAEvE;;;;;;OAMG;IACH,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAE7E;;;;;;OAMG;IACH,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAE7F;;;;OAIG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzC;;;;OAIG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAExC;;;;OAIG;IACH,wBAAwB,CAAC,QAAQ,EAAE,eAAe,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAElE;;OAEG;IACH,2BAA2B,IAAI,IAAI,CAAC;IAEpC;;;;OAIG;IACH,4BAA4B,CAAC,QAAQ,EAAE,eAAe,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;IAEhF;;OAEG;IACH,+BAA+B,IAAI,IAAI,CAAC;IAExC;;;;OAIG;IACH,yBAAyB,CAAC,QAAQ,EAAE,eAAe,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAEnE;;OAEG;IACH,4BAA4B,IAAI,IAAI,CAAC;IAErC;;;;OAIG;IACH,2BAA2B,CAAC,QAAQ,EAAE,eAAe,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAErE;;OAEG;IACH,8BAA8B,IAAI,IAAI,CAAC;IAEvC;;;;OAIG;IACH,0BAA0B,CAAC,QAAQ,EAAE,eAAe,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAEpE;;OAEG;IACH,6BAA6B,IAAI,IAAI,CAAC;IAEtC;;;;OAIG;IACH,wBAAwB,CAAC,QAAQ,EAAE,eAAe,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAElE;;OAEG;IACH,2BAA2B,IAAI,IAAI,CAAC;CACvC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-applovin-max",
|
|
3
3
|
"author": "AppLovin Corporation <support@applovin.com> (https://applovin.com)",
|
|
4
|
-
"version": "9.
|
|
4
|
+
"version": "9.1.0",
|
|
5
5
|
"description": "AppLovin MAX React Native Plugin for Android and iOS",
|
|
6
6
|
"main": "lib/commonjs/index",
|
|
7
7
|
"module": "lib/module/index",
|
|
@@ -11,11 +11,11 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.authors = package["author"]
|
|
12
12
|
|
|
13
13
|
s.platforms = { :ios => min_ios_version_supported }
|
|
14
|
-
s.source = { :git => "https://github.com/AppLovin/AppLovin-MAX-React-Native.git", :tag => "
|
|
14
|
+
s.source = { :git => "https://github.com/AppLovin/AppLovin-MAX-React-Native.git", :tag => "release_9_1_0" }
|
|
15
15
|
|
|
16
16
|
s.source_files = "ios/AppLovinMAX*.{h,mm}"
|
|
17
17
|
|
|
18
|
-
s.dependency "AppLovinSDK", "13.
|
|
18
|
+
s.dependency "AppLovinSDK", "13.2.0"
|
|
19
19
|
|
|
20
20
|
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
21
21
|
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
package/src/AdView.tsx
CHANGED
|
@@ -13,7 +13,7 @@ import { makeExtraParametersArray, makeLocalExtraParametersArray } from './Utils
|
|
|
13
13
|
const { ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOADED_EVENT, ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOAD_FAILED_EVENT } = AppLovinMAX.getConstants();
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* Defines
|
|
16
|
+
* Defines the format of an ad.
|
|
17
17
|
*/
|
|
18
18
|
export enum AdFormat {
|
|
19
19
|
/**
|
|
@@ -28,7 +28,7 @@ export enum AdFormat {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* Defines
|
|
31
|
+
* Defines the position for rendering a banner or MREC ad within its container.
|
|
32
32
|
*/
|
|
33
33
|
export enum AdViewPosition {
|
|
34
34
|
TOP_CENTER = 'top_center',
|
|
@@ -51,76 +51,53 @@ const ADVIEW_SIZE = {
|
|
|
51
51
|
mrec: { width: 300, height: 250 },
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
//
|
|
54
|
+
// Extracts width and height from the style prop, defaulting to 'auto' when unspecified.
|
|
55
55
|
const getOutlineViewSize = (style: StyleProp<ViewStyle>): [DimensionValue, DimensionValue] => {
|
|
56
56
|
const viewStyle = StyleSheet.flatten(style) || {};
|
|
57
57
|
return [viewStyle.width ?? 'auto', viewStyle.height ?? 'auto'];
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
const sizeBannerDimensions = async (sizeProps: SizeRecord, adaptiveBannerEnabled: boolean, screenWidth: number, bannerFormatSize: SizeRecord): Promise<SizeRecord> => {
|
|
61
|
-
const width = sizeProps.width === 'auto' ? screenWidth : sizeProps.width;
|
|
62
|
-
|
|
63
|
-
let height;
|
|
64
|
-
if (sizeProps.height === 'auto') {
|
|
65
|
-
if (adaptiveBannerEnabled) {
|
|
66
|
-
try {
|
|
67
|
-
height = await AppLovinMAX.getAdaptiveBannerHeightForWidth(screenWidth);
|
|
68
|
-
} catch (error) {
|
|
69
|
-
console.error('Error getting adaptive banner height:', error);
|
|
70
|
-
height = bannerFormatSize.height;
|
|
71
|
-
}
|
|
72
|
-
} else {
|
|
73
|
-
height = bannerFormatSize.height;
|
|
74
|
-
}
|
|
75
|
-
} else {
|
|
76
|
-
height = sizeProps.height;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return { width, height };
|
|
80
|
-
};
|
|
81
|
-
|
|
82
60
|
const handleAdViewEvent = <T extends AdInfoEvent | AdLoadFailedEvent | AdDisplayFailedEvent>(event: NativeSyntheticEvent<T>, callback?: (adInfo: T) => void) => {
|
|
83
61
|
if (!callback) return;
|
|
84
|
-
|
|
85
|
-
let adInfo: any = { ...event.nativeEvent };
|
|
86
|
-
|
|
87
|
-
if ('size' in event.nativeEvent) {
|
|
88
|
-
adInfo.size = {
|
|
89
|
-
width: event.nativeEvent.size?.width ?? 0,
|
|
90
|
-
height: event.nativeEvent.size?.height ?? 0,
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
callback(adInfo);
|
|
62
|
+
callback(event.nativeEvent);
|
|
95
63
|
};
|
|
96
64
|
|
|
97
65
|
/**
|
|
98
|
-
*
|
|
99
|
-
* - **Banners**: 320x50 on phones, 728x90 on tablets.
|
|
100
|
-
* - **MRECs**: 300x250 on all devices.
|
|
66
|
+
* Renders a banner or MREC ad using a native view, with adaptive or responsive sizing.
|
|
101
67
|
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
68
|
+
* - **Banners**: 320×50 on phones, 728×90 on tablets.
|
|
69
|
+
* - **MRECs**: Fixed size of 300×250 on all devices.
|
|
70
|
+
*
|
|
71
|
+
* Internally uses {@link AppLovinMAX.isTablet()} to determine banner size on tablets.
|
|
72
|
+
* You can also use this method externally to assist with layout decisions.
|
|
73
|
+
*
|
|
74
|
+
* For adaptive banners, use {@link BannerAd.getAdaptiveHeightForWidth()} to determine the appropriate height.
|
|
104
75
|
*
|
|
105
76
|
* **Preloading**:
|
|
106
|
-
*
|
|
107
|
-
* the returned {@link AdViewId}
|
|
77
|
+
* If you preload an ad for AdView using {@link preloadNativeUIComponentAdView},
|
|
78
|
+
* pass the returned {@link AdViewId} to this component to display the preloaded instance.
|
|
79
|
+
*
|
|
80
|
+
* **Note:** The AppLovin SDK must be initialized before using this component.
|
|
108
81
|
*
|
|
109
82
|
* ### Example:
|
|
110
|
-
* ```
|
|
83
|
+
* ```tsx
|
|
111
84
|
* <AdView
|
|
112
85
|
* adUnitId={adUnitId}
|
|
113
86
|
* adFormat={AdFormat.BANNER}
|
|
114
87
|
* placement="my_placement"
|
|
115
88
|
* customData="my_customData"
|
|
116
|
-
* extraParameters={{
|
|
117
|
-
* localExtraParameters={{
|
|
89
|
+
* extraParameters={{ key1: "value1", key2: "value2" }}
|
|
90
|
+
* localExtraParameters={{ key1: "value1", key2: true }}
|
|
118
91
|
* adaptiveBannerEnabled={false}
|
|
119
92
|
* autoRefresh={false}
|
|
120
93
|
* style={styles.banner}
|
|
121
94
|
* onAdLoaded={(adInfo: AdInfo) => { ... }}
|
|
122
95
|
* />
|
|
123
96
|
* ```
|
|
97
|
+
*
|
|
98
|
+
* For complete implementation examples, see:
|
|
99
|
+
* - https://github.com/AppLovin/AppLovin-MAX-React-Native/blob/master/example/src/NativeBannerExample.tsx
|
|
100
|
+
* - https://github.com/AppLovin/AppLovin-MAX-React-Native/blob/master/example/src/NativeMRecExample.tsx
|
|
124
101
|
*/
|
|
125
102
|
export const AdView = forwardRef<AdViewHandler, AdViewProps & ViewProps>(function AdView(
|
|
126
103
|
{
|
|
@@ -151,10 +128,13 @@ export const AdView = forwardRef<AdViewHandler, AdViewProps & ViewProps>(functio
|
|
|
151
128
|
const [, forceUpdate] = useReducer((x) => x + 1, 0);
|
|
152
129
|
const adViewRef = useRef<React.ElementRef<typeof AdViewComponent> | undefined>();
|
|
153
130
|
const [isInitialized, setIsInitialized] = useState<boolean>(false);
|
|
154
|
-
const sizeProps = useRef<SizeRecord>({});
|
|
155
131
|
const dimensions = useRef<SizeRecord>({});
|
|
156
132
|
|
|
157
|
-
|
|
133
|
+
const loadAd = useCallback(() => {
|
|
134
|
+
adViewRef.current && Commands.loadAd(adViewRef.current);
|
|
135
|
+
}, []);
|
|
136
|
+
|
|
137
|
+
useImperativeHandle(ref, () => ({ loadAd }), [loadAd]);
|
|
158
138
|
|
|
159
139
|
useEffect(() => {
|
|
160
140
|
(async () => {
|
|
@@ -164,7 +144,7 @@ export const AdView = forwardRef<AdViewHandler, AdViewProps & ViewProps>(functio
|
|
|
164
144
|
const initialized = await AppLovinMAX.isInitialized();
|
|
165
145
|
setIsInitialized(initialized);
|
|
166
146
|
if (!initialized) {
|
|
167
|
-
console.warn('AdView
|
|
147
|
+
console.warn('AdView was mounted before the AppLovin MAX React Native module was initialized.');
|
|
168
148
|
}
|
|
169
149
|
})();
|
|
170
150
|
}, [adFormat]);
|
|
@@ -172,45 +152,50 @@ export const AdView = forwardRef<AdViewHandler, AdViewProps & ViewProps>(functio
|
|
|
172
152
|
useEffect(() => {
|
|
173
153
|
const [width, height] = getOutlineViewSize(style);
|
|
174
154
|
|
|
175
|
-
if (
|
|
176
|
-
|
|
177
|
-
sizeProps.current = { width, height };
|
|
155
|
+
if (dimensions.current.width === width && dimensions.current.height === height) return;
|
|
178
156
|
|
|
179
157
|
(async () => {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
158
|
+
const isBanner = adFormat === AdFormat.BANNER;
|
|
159
|
+
const isWidthAuto = width === 'auto';
|
|
160
|
+
const isHeightAuto = height === 'auto';
|
|
161
|
+
|
|
162
|
+
const resolvedWidth = isWidthAuto ? (isBanner ? screenWidth : adFormatSize.current.width) : width;
|
|
163
|
+
|
|
164
|
+
let resolvedHeight: DimensionValue | undefined = height;
|
|
165
|
+
|
|
166
|
+
if (isHeightAuto) {
|
|
167
|
+
if (isBanner && adaptiveBannerEnabled) {
|
|
168
|
+
try {
|
|
169
|
+
resolvedHeight = await AppLovinMAX.getAdaptiveBannerHeightForWidth(screenWidth);
|
|
170
|
+
} catch (error) {
|
|
171
|
+
console.error('Error getting adaptive banner height:', error);
|
|
172
|
+
resolvedHeight = adFormatSize.current.height;
|
|
173
|
+
}
|
|
174
|
+
} else {
|
|
175
|
+
resolvedHeight = adFormatSize.current.height;
|
|
186
176
|
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const newSize = { width: resolvedWidth, height: resolvedHeight };
|
|
180
|
+
|
|
181
|
+
if (dimensions.current.width !== newSize.width || dimensions.current.height !== newSize.height) {
|
|
182
|
+
dimensions.current = newSize;
|
|
192
183
|
forceUpdate();
|
|
193
184
|
}
|
|
194
185
|
})();
|
|
195
186
|
}, [adFormat, adaptiveBannerEnabled, isInitialized, screenWidth, style]);
|
|
196
187
|
|
|
197
188
|
const onAdLoadedEvent = useCallback((event: NativeSyntheticEvent<AdInfoEvent>) => handleAdViewEvent(event, onAdLoaded), [onAdLoaded]);
|
|
198
|
-
|
|
199
189
|
const onAdLoadFailedEvent = useCallback((event: NativeSyntheticEvent<AdLoadFailedEvent>) => handleAdViewEvent(event, onAdLoadFailed), [onAdLoadFailed]);
|
|
200
|
-
|
|
201
190
|
const onAdDisplayFailedEvent = useCallback((event: NativeSyntheticEvent<AdDisplayFailedEvent>) => handleAdViewEvent(event, onAdDisplayFailed), [onAdDisplayFailed]);
|
|
202
|
-
|
|
203
191
|
const onAdClickedEvent = useCallback((event: NativeSyntheticEvent<AdInfoEvent>) => handleAdViewEvent(event, onAdClicked), [onAdClicked]);
|
|
204
|
-
|
|
205
192
|
const onAdExpandedEvent = useCallback((event: NativeSyntheticEvent<AdInfoEvent>) => handleAdViewEvent(event, onAdExpanded), [onAdExpanded]);
|
|
206
|
-
|
|
207
193
|
const onAdCollapsedEvent = useCallback((event: NativeSyntheticEvent<AdInfoEvent>) => handleAdViewEvent(event, onAdCollapsed), [onAdCollapsed]);
|
|
208
|
-
|
|
209
194
|
const onAdRevenuePaidEvent = useCallback((event: NativeSyntheticEvent<AdInfoEvent>) => handleAdViewEvent(event, onAdRevenuePaid), [onAdRevenuePaid]);
|
|
210
195
|
|
|
211
196
|
if (!isInitialized || Object.keys(dimensions.current).length === 0) {
|
|
212
197
|
// Early return if not initialized or dimensions are not set
|
|
213
|
-
return <View style={
|
|
198
|
+
return <View style={style} {...otherProps} />;
|
|
214
199
|
}
|
|
215
200
|
|
|
216
201
|
return (
|
|
@@ -234,7 +219,7 @@ export const AdView = forwardRef<AdViewHandler, AdViewProps & ViewProps>(functio
|
|
|
234
219
|
onAdExpandedEvent={onAdExpandedEvent}
|
|
235
220
|
onAdCollapsedEvent={onAdCollapsedEvent}
|
|
236
221
|
onAdRevenuePaidEvent={onAdRevenuePaidEvent}
|
|
237
|
-
style={
|
|
222
|
+
style={[style, dimensions.current]}
|
|
238
223
|
{...otherProps}
|
|
239
224
|
/>
|
|
240
225
|
);
|
|
@@ -247,10 +232,10 @@ export const AdView = forwardRef<AdViewHandler, AdViewProps & ViewProps>(functio
|
|
|
247
232
|
* - Unmounting {@link AdView} does not destroy the preloaded component—it will be reused on the next mount.
|
|
248
233
|
* - You must manually destroy the preloaded component when it is no longer needed using {@link destroyNativeUIComponentAdView}.
|
|
249
234
|
*
|
|
250
|
-
* @param adUnitId - The Ad Unit ID for which
|
|
235
|
+
* @param adUnitId - The Ad Unit ID for which ads should be preloaded.
|
|
251
236
|
* @param adFormat - The ad format to preload. Must be either {@link AdFormat.BANNER} or {@link AdFormat.MREC}.
|
|
252
237
|
* @param options - Optional properties to configure the native UI component (e.g., placement, custom data).
|
|
253
|
-
* @returns A promise
|
|
238
|
+
* @returns A promise that resolves to an {@link AdViewId}, uniquely identifying the preloaded component instance.
|
|
254
239
|
* @throws An error if the preload request fails.
|
|
255
240
|
*/
|
|
256
241
|
export const preloadNativeUIComponentAdView = async (adUnitId: string, adFormat: AdFormat, options: NativeUIComponentAdViewOptions = {}): Promise<AdViewId> => {
|
|
@@ -275,8 +260,7 @@ export const destroyNativeUIComponentAdView = async (adViewId: AdViewId): Promis
|
|
|
275
260
|
};
|
|
276
261
|
|
|
277
262
|
/**
|
|
278
|
-
* Adds the specified event listener to receive {@link AdInfo} when a native UI component loads a
|
|
279
|
-
* new ad.
|
|
263
|
+
* Adds the specified event listener to receive {@link AdInfo} when a native UI component loads a new ad.
|
|
280
264
|
*
|
|
281
265
|
* @param listener Listener to be notified.
|
|
282
266
|
*/
|
|
@@ -285,15 +269,14 @@ export const addNativeUIComponentAdViewAdLoadedEventListener = (listener: (adInf
|
|
|
285
269
|
};
|
|
286
270
|
|
|
287
271
|
/**
|
|
288
|
-
* Removes the event listener to receive {@link AdInfo} when a native UI component loads a new ad.
|
|
272
|
+
* Removes the event listener registered to receive {@link AdInfo} when a native UI component loads a new ad.
|
|
289
273
|
*/
|
|
290
274
|
export const removeNativeUIComponentAdViewAdLoadedEventListener = (): void => {
|
|
291
275
|
removeEventListener(ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOADED_EVENT);
|
|
292
276
|
};
|
|
293
277
|
|
|
294
278
|
/**
|
|
295
|
-
* Adds the specified event listener to receive {@link AdLoadFailedInfo} when a native UI component
|
|
296
|
-
* could not load a new ad.
|
|
279
|
+
* Adds the specified event listener to receive {@link AdLoadFailedInfo} when a native UI component could not load a new ad.
|
|
297
280
|
*
|
|
298
281
|
* @param listener Listener to be notified.
|
|
299
282
|
*/
|
|
@@ -302,8 +285,7 @@ export const addNativeUIComponentAdViewAdLoadFailedEventListener = (listener: (e
|
|
|
302
285
|
};
|
|
303
286
|
|
|
304
287
|
/**
|
|
305
|
-
* Removes the event listener to receive {@link AdLoadFailedInfo} when a native UI component could
|
|
306
|
-
* not load a new ad.
|
|
288
|
+
* Removes the event listener registered to receive {@link AdLoadFailedInfo} when a native UI component could not load a new ad.
|
|
307
289
|
*/
|
|
308
290
|
export const removeNativeUIComponentAdViewAdLoadFailedEventListener = (): void => {
|
|
309
291
|
removeEventListener(ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOAD_FAILED_EVENT);
|