cloudx-react-native 2.0.0-beta.1 → 2.2.3
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/README.md +420 -1046
- package/android/build.gradle +1 -2
- package/android/src/main/AndroidManifest.xml +0 -4
- package/android/src/main/java/com/cloudxreactnative/CloudXAdEvents.kt +39 -0
- package/android/src/main/java/com/cloudxreactnative/CloudXAdInfo.kt +32 -0
- package/android/src/main/java/com/cloudxreactnative/CloudXModuleImpl.kt +694 -0
- package/android/src/{newarch/com/cloudxreactnative/CloudXReactNativePackage.kt → main/java/com/cloudxreactnative/CloudXPackage.kt} +14 -13
- package/android/src/newarch/com/cloudxreactnative/{CloudXReactNativeModule.kt → CloudXModule.kt} +31 -34
- package/android/src/oldarch/com/cloudxreactnative/{CloudXReactNativeModule.kt → CloudXModule.kt} +27 -32
- package/cloudx-react-native.podspec +1 -1
- package/ios/CloudX.h +47 -0
- package/ios/CloudX.mm +1406 -0
- package/lib/commonjs/AppTrackingTransparency.js +13 -13
- package/lib/commonjs/AppTrackingTransparency.js.map +1 -1
- package/lib/commonjs/CloudX.js +16 -12
- package/lib/commonjs/CloudX.js.map +1 -1
- package/lib/commonjs/CloudXAdPosition.js +23 -0
- package/lib/commonjs/CloudXAdPosition.js.map +1 -0
- package/lib/commonjs/{BannerAd.js → CloudXBannerAd.js} +42 -37
- package/lib/commonjs/CloudXBannerAd.js.map +1 -0
- package/lib/commonjs/CloudXErrorCode.js +116 -0
- package/lib/commonjs/CloudXErrorCode.js.map +1 -0
- package/lib/commonjs/{InterstitialAd.js → CloudXInterstitialAd.js} +10 -10
- package/lib/commonjs/CloudXInterstitialAd.js.map +1 -0
- package/lib/commonjs/{MRecAd.js → CloudXMRECAd.js} +42 -37
- package/lib/commonjs/CloudXMRECAd.js.map +1 -0
- package/lib/commonjs/{RewardedAd.js → CloudXRewardedAd.js} +10 -10
- package/lib/commonjs/CloudXRewardedAd.js.map +1 -0
- package/lib/commonjs/EventEmitter.js +3 -3
- package/lib/commonjs/EventEmitter.js.map +1 -1
- package/lib/commonjs/hooks.js +25 -26
- package/lib/commonjs/hooks.js.map +1 -1
- package/lib/commonjs/index.js +27 -41
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/specs/{NativeCloudXModule.js → NativeCloudX.js} +2 -2
- package/lib/commonjs/specs/NativeCloudX.js.map +1 -0
- package/lib/commonjs/types/AdProps.js +6 -0
- package/lib/commonjs/types/AdProps.js.map +1 -0
- package/lib/commonjs/types/InterstitialAd.js +6 -0
- package/lib/commonjs/types/InterstitialAd.js.map +1 -0
- package/lib/commonjs/types/MRECAd.js +6 -0
- package/lib/commonjs/types/MRECAd.js.map +1 -0
- package/lib/commonjs/types/ViewAd.js +6 -0
- package/lib/commonjs/types/ViewAd.js.map +1 -0
- package/lib/module/AppTrackingTransparency.js +12 -12
- package/lib/module/AppTrackingTransparency.js.map +1 -1
- package/lib/module/CloudX.js +16 -12
- package/lib/module/CloudX.js.map +1 -1
- package/lib/module/CloudXAdPosition.js +17 -0
- package/lib/module/CloudXAdPosition.js.map +1 -0
- package/lib/module/{BannerAd.js → CloudXBannerAd.js} +41 -36
- package/lib/module/CloudXBannerAd.js.map +1 -0
- package/lib/module/CloudXErrorCode.js +110 -0
- package/lib/module/CloudXErrorCode.js.map +1 -0
- package/lib/module/{InterstitialAd.js → CloudXInterstitialAd.js} +9 -9
- package/lib/module/CloudXInterstitialAd.js.map +1 -0
- package/lib/module/{MRecAd.js → CloudXMRECAd.js} +41 -36
- package/lib/module/CloudXMRECAd.js.map +1 -0
- package/lib/module/{RewardedAd.js → CloudXRewardedAd.js} +9 -9
- package/lib/module/CloudXRewardedAd.js.map +1 -0
- package/lib/module/EventEmitter.js +2 -2
- package/lib/module/EventEmitter.js.map +1 -1
- package/lib/module/hooks.js +14 -15
- package/lib/module/hooks.js.map +1 -1
- package/lib/module/index.js +9 -10
- package/lib/module/index.js.map +1 -1
- package/lib/module/specs/{NativeCloudXModule.js → NativeCloudX.js} +2 -2
- package/lib/module/specs/NativeCloudX.js.map +1 -0
- package/lib/module/types/AdProps.js +2 -0
- package/lib/module/types/AdProps.js.map +1 -0
- package/lib/module/types/InterstitialAd.js +2 -0
- package/lib/module/types/InterstitialAd.js.map +1 -0
- package/lib/module/types/MRECAd.js +2 -0
- package/lib/module/types/MRECAd.js.map +1 -0
- package/lib/module/types/ViewAd.js +2 -0
- package/lib/module/types/ViewAd.js.map +1 -0
- package/lib/typescript/src/AppTrackingTransparency.d.ts +4 -4
- package/lib/typescript/src/AppTrackingTransparency.d.ts.map +1 -1
- package/lib/typescript/src/CloudX.d.ts.map +1 -1
- package/lib/typescript/src/CloudXAdPosition.d.ts +16 -0
- package/lib/typescript/src/CloudXAdPosition.d.ts.map +1 -0
- package/lib/typescript/src/CloudXBannerAd.d.ts +4 -0
- package/lib/typescript/src/CloudXBannerAd.d.ts.map +1 -0
- package/lib/typescript/src/{ErrorCode.d.ts → CloudXErrorCode.d.ts} +2 -2
- package/lib/typescript/src/CloudXErrorCode.d.ts.map +1 -0
- package/lib/typescript/src/CloudXInterstitialAd.d.ts +4 -0
- package/lib/typescript/src/CloudXInterstitialAd.d.ts.map +1 -0
- package/lib/typescript/src/CloudXMRECAd.d.ts +4 -0
- package/lib/typescript/src/CloudXMRECAd.d.ts.map +1 -0
- package/lib/typescript/src/CloudXRewardedAd.d.ts +4 -0
- package/lib/typescript/src/CloudXRewardedAd.d.ts.map +1 -0
- package/lib/typescript/src/EventEmitter.d.ts +4 -2
- package/lib/typescript/src/EventEmitter.d.ts.map +1 -1
- package/lib/typescript/src/hooks.d.ts +7 -8
- package/lib/typescript/src/hooks.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +12 -13
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/{NativeCloudXModule.d.ts → NativeCloudX.d.ts} +47 -64
- package/lib/typescript/src/specs/NativeCloudX.d.ts.map +1 -0
- package/lib/typescript/src/types/AdEvent.d.ts +3 -3
- package/lib/typescript/src/types/AdEvent.d.ts.map +1 -1
- package/lib/typescript/src/types/AdInfo.d.ts +7 -7
- package/lib/typescript/src/types/AdInfo.d.ts.map +1 -1
- package/lib/typescript/src/types/AdProps.d.ts +21 -0
- package/lib/typescript/src/types/AdProps.d.ts.map +1 -0
- package/lib/typescript/src/types/BannerAd.d.ts +8 -34
- package/lib/typescript/src/types/BannerAd.d.ts.map +1 -1
- package/lib/typescript/src/types/CloudX.d.ts +7 -4
- package/lib/typescript/src/types/CloudX.d.ts.map +1 -1
- package/lib/typescript/src/types/Configuration.d.ts +7 -3
- package/lib/typescript/src/types/Configuration.d.ts.map +1 -1
- package/lib/typescript/src/types/FullscreenAd.d.ts +10 -9
- package/lib/typescript/src/types/FullscreenAd.d.ts.map +1 -1
- package/lib/typescript/src/types/InterstitialAd.d.ts +8 -0
- package/lib/typescript/src/types/InterstitialAd.d.ts.map +1 -0
- package/lib/typescript/src/types/MRECAd.d.ts +13 -0
- package/lib/typescript/src/types/MRECAd.d.ts.map +1 -0
- package/lib/typescript/src/types/RewardedAd.d.ts +5 -4
- package/lib/typescript/src/types/RewardedAd.d.ts.map +1 -1
- package/lib/typescript/src/types/ViewAd.d.ts +29 -0
- package/lib/typescript/src/types/ViewAd.d.ts.map +1 -0
- package/lib/typescript/src/types/index.d.ts +11 -7
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/package.json +8 -10
- package/src/AppTrackingTransparency.ts +10 -10
- package/src/CloudX.ts +21 -16
- package/src/CloudXAdPosition.ts +16 -0
- package/src/{BannerAd.ts → CloudXBannerAd.ts} +69 -47
- package/src/{ErrorCode.ts → CloudXErrorCode.ts} +1 -1
- package/src/{InterstitialAd.ts → CloudXInterstitialAd.ts} +17 -17
- package/src/{MRecAd.ts → CloudXMRECAd.ts} +69 -47
- package/src/{RewardedAd.ts → CloudXRewardedAd.ts} +18 -18
- package/src/EventEmitter.ts +4 -4
- package/src/hooks.ts +20 -22
- package/src/index.ts +27 -24
- package/src/specs/{NativeCloudXModule.ts → NativeCloudX.ts} +61 -82
- package/src/types/AdEvent.ts +3 -3
- package/src/types/AdInfo.ts +7 -7
- package/src/types/AdProps.ts +27 -0
- package/src/types/BannerAd.ts +8 -54
- package/src/types/CloudX.ts +10 -5
- package/src/types/Configuration.ts +8 -3
- package/src/types/FullscreenAd.ts +10 -9
- package/src/types/InterstitialAd.ts +8 -0
- package/src/types/MRECAd.ts +13 -0
- package/src/types/RewardedAd.ts +5 -4
- package/src/types/ViewAd.ts +38 -0
- package/src/types/index.ts +11 -7
- package/android/src/main/java/com/cloudxreactnative/CloudXAdViewEvent.kt +0 -15
- package/android/src/main/java/com/cloudxreactnative/CloudXBannerViewManagerImpl.kt +0 -472
- package/android/src/main/java/com/cloudxreactnative/CloudXReactNativeModuleImpl.kt +0 -861
- package/android/src/newarch/com/cloudxreactnative/CloudXBannerViewManager.kt +0 -90
- package/android/src/oldarch/com/cloudxreactnative/CloudXBannerViewManager.kt +0 -76
- package/android/src/oldarch/com/cloudxreactnative/CloudXReactNativePackage.kt +0 -16
- package/ios/RNCloudXBannerView.h +0 -51
- package/ios/RNCloudXBannerView.mm +0 -633
- package/ios/RNCloudXBannerViewManager.h +0 -11
- package/ios/RNCloudXBannerViewManager.mm +0 -60
- package/ios/RNCloudXModule.h +0 -30
- package/ios/RNCloudXModule.mm +0 -1088
- package/lib/commonjs/AdView.js +0 -151
- package/lib/commonjs/AdView.js.map +0 -1
- package/lib/commonjs/BannerAd.js.map +0 -1
- package/lib/commonjs/ErrorCode.js +0 -116
- package/lib/commonjs/ErrorCode.js.map +0 -1
- package/lib/commonjs/InterstitialAd.js.map +0 -1
- package/lib/commonjs/MRecAd.js.map +0 -1
- package/lib/commonjs/RewardedAd.js.map +0 -1
- package/lib/commonjs/specs/CloudXAdViewNativeComponent.js +0 -26
- package/lib/commonjs/specs/CloudXAdViewNativeComponent.js.map +0 -1
- package/lib/commonjs/specs/NativeCloudXModule.js.map +0 -1
- package/lib/module/AdView.js +0 -144
- package/lib/module/AdView.js.map +0 -1
- package/lib/module/BannerAd.js.map +0 -1
- package/lib/module/ErrorCode.js +0 -110
- package/lib/module/ErrorCode.js.map +0 -1
- package/lib/module/InterstitialAd.js.map +0 -1
- package/lib/module/MRecAd.js.map +0 -1
- package/lib/module/RewardedAd.js.map +0 -1
- package/lib/module/specs/CloudXAdViewNativeComponent.js +0 -20
- package/lib/module/specs/CloudXAdViewNativeComponent.js.map +0 -1
- package/lib/module/specs/NativeCloudXModule.js.map +0 -1
- package/lib/typescript/src/AdView.d.ts +0 -69
- package/lib/typescript/src/AdView.d.ts.map +0 -1
- package/lib/typescript/src/BannerAd.d.ts +0 -4
- package/lib/typescript/src/BannerAd.d.ts.map +0 -1
- package/lib/typescript/src/ErrorCode.d.ts.map +0 -1
- package/lib/typescript/src/InterstitialAd.d.ts +0 -4
- package/lib/typescript/src/InterstitialAd.d.ts.map +0 -1
- package/lib/typescript/src/MRecAd.d.ts +0 -4
- package/lib/typescript/src/MRecAd.d.ts.map +0 -1
- package/lib/typescript/src/RewardedAd.d.ts +0 -4
- package/lib/typescript/src/RewardedAd.d.ts.map +0 -1
- package/lib/typescript/src/specs/CloudXAdViewNativeComponent.d.ts +0 -61
- package/lib/typescript/src/specs/CloudXAdViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/src/specs/NativeCloudXModule.d.ts.map +0 -1
- package/src/AdView.tsx +0 -213
- package/src/specs/CloudXAdViewNativeComponent.ts +0 -82
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TurboModule } from 'react-native';
|
|
2
2
|
import { TurboModuleRegistry } from 'react-native';
|
|
3
|
+
import type { CloudXConfiguration } from '../types/Configuration';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* TurboModule spec for the CloudX native module.
|
|
@@ -12,18 +13,52 @@ import { TurboModuleRegistry } from 'react-native';
|
|
|
12
13
|
*/
|
|
13
14
|
export interface Spec extends TurboModule {
|
|
14
15
|
// =========================================================================
|
|
15
|
-
//
|
|
16
|
+
// Constants (event names)
|
|
16
17
|
// =========================================================================
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
readonly getConstants: () => {
|
|
20
|
+
// Banner events
|
|
21
|
+
ON_BANNER_AD_LOADED_EVENT: string;
|
|
22
|
+
ON_BANNER_AD_LOAD_FAILED_EVENT: string;
|
|
23
|
+
ON_BANNER_AD_CLICKED_EVENT: string;
|
|
24
|
+
ON_BANNER_AD_EXPANDED_EVENT: string;
|
|
25
|
+
ON_BANNER_AD_COLLAPSED_EVENT: string;
|
|
26
|
+
ON_BANNER_AD_REVENUE_PAID: string;
|
|
27
|
+
|
|
28
|
+
// MREC events
|
|
29
|
+
ON_MREC_AD_LOADED_EVENT: string;
|
|
30
|
+
ON_MREC_AD_LOAD_FAILED_EVENT: string;
|
|
31
|
+
ON_MREC_AD_CLICKED_EVENT: string;
|
|
32
|
+
ON_MREC_AD_EXPANDED_EVENT: string;
|
|
33
|
+
ON_MREC_AD_COLLAPSED_EVENT: string;
|
|
34
|
+
ON_MREC_AD_REVENUE_PAID: string;
|
|
35
|
+
|
|
36
|
+
// Interstitial events
|
|
37
|
+
ON_INTERSTITIAL_LOADED_EVENT: string;
|
|
38
|
+
ON_INTERSTITIAL_LOAD_FAILED_EVENT: string;
|
|
39
|
+
ON_INTERSTITIAL_CLICKED_EVENT: string;
|
|
40
|
+
ON_INTERSTITIAL_DISPLAYED_EVENT: string;
|
|
41
|
+
ON_INTERSTITIAL_DISPLAY_FAILED_EVENT: string;
|
|
42
|
+
ON_INTERSTITIAL_HIDDEN_EVENT: string;
|
|
43
|
+
ON_INTERSTITIAL_AD_REVENUE_PAID: string;
|
|
44
|
+
|
|
45
|
+
// Rewarded events
|
|
46
|
+
ON_REWARDED_AD_LOADED_EVENT: string;
|
|
47
|
+
ON_REWARDED_AD_LOAD_FAILED_EVENT: string;
|
|
48
|
+
ON_REWARDED_AD_CLICKED_EVENT: string;
|
|
49
|
+
ON_REWARDED_AD_DISPLAYED_EVENT: string;
|
|
50
|
+
ON_REWARDED_AD_DISPLAY_FAILED_EVENT: string;
|
|
51
|
+
ON_REWARDED_AD_HIDDEN_EVENT: string;
|
|
52
|
+
ON_REWARDED_AD_RECEIVED_REWARD_EVENT: string;
|
|
53
|
+
ON_REWARDED_AD_REVENUE_PAID: string;
|
|
54
|
+
};
|
|
20
55
|
|
|
21
56
|
// =========================================================================
|
|
22
57
|
// Initialization
|
|
23
58
|
// =========================================================================
|
|
24
59
|
|
|
25
|
-
initialize(pluginVersion: string, appKey: string): Promise<Object>;
|
|
26
60
|
isInitialized(): Promise<boolean>;
|
|
61
|
+
initialize(pluginVersion: string, appKey: string): Promise<CloudXConfiguration>;
|
|
27
62
|
isTablet(): Promise<boolean>;
|
|
28
63
|
getVersion(): Promise<string>;
|
|
29
64
|
|
|
@@ -49,33 +84,33 @@ export interface Spec extends TurboModule {
|
|
|
49
84
|
|
|
50
85
|
createBanner(adUnitId: string, position: string): void;
|
|
51
86
|
createBannerWithOffsets(adUnitId: string, position: string, xOffset: number, yOffset: number): void;
|
|
52
|
-
|
|
53
|
-
hideBanner(adUnitId: string): void;
|
|
54
|
-
destroyBanner(adUnitId: string): void;
|
|
87
|
+
setBannerBackgroundColor(adUnitId: string, hexColorString: string): void;
|
|
55
88
|
setBannerPlacement(adUnitId: string, placement: string | null): void;
|
|
56
89
|
setBannerCustomData(adUnitId: string, customData: string | null): void;
|
|
57
|
-
startBannerAutoRefresh(adUnitId: string): void;
|
|
58
|
-
stopBannerAutoRefresh(adUnitId: string): void;
|
|
59
90
|
updateBannerPosition(adUnitId: string, position: string): void;
|
|
60
91
|
updateBannerOffsets(adUnitId: string, xOffset: number, yOffset: number): void;
|
|
61
|
-
|
|
92
|
+
startBannerAutoRefresh(adUnitId: string): void;
|
|
93
|
+
stopBannerAutoRefresh(adUnitId: string): void;
|
|
94
|
+
showBanner(adUnitId: string): void;
|
|
95
|
+
hideBanner(adUnitId: string): void;
|
|
96
|
+
destroyBanner(adUnitId: string): void;
|
|
62
97
|
|
|
63
98
|
// =========================================================================
|
|
64
99
|
// MREC (Programmatic)
|
|
65
100
|
// =========================================================================
|
|
66
101
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
102
|
+
createMREC(adUnitId: string, position: string): void;
|
|
103
|
+
createMRECWithOffsets(adUnitId: string, position: string, xOffset: number, yOffset: number): void;
|
|
104
|
+
setMRECPlacement(adUnitId: string, placement: string | null): void;
|
|
105
|
+
setMRECCustomData(adUnitId: string, customData: string | null): void;
|
|
106
|
+
updateMRECPosition(adUnitId: string, position: string): void;
|
|
107
|
+
updateMRECOffsets(adUnitId: string, xOffset: number, yOffset: number): void;
|
|
108
|
+
startMRECAutoRefresh(adUnitId: string): void;
|
|
109
|
+
stopMRECAutoRefresh(adUnitId: string): void;
|
|
110
|
+
showMREC(adUnitId: string): void;
|
|
111
|
+
hideMREC(adUnitId: string): void;
|
|
112
|
+
destroyMREC(adUnitId: string): void;
|
|
113
|
+
setMRECBackgroundColor(adUnitId: string, hexColorString: string): void;
|
|
79
114
|
|
|
80
115
|
// =========================================================================
|
|
81
116
|
// Interstitial
|
|
@@ -96,67 +131,11 @@ export interface Spec extends TurboModule {
|
|
|
96
131
|
destroyRewarded(adUnitId: string): void;
|
|
97
132
|
|
|
98
133
|
// =========================================================================
|
|
99
|
-
//
|
|
134
|
+
// Event Emitter (required by NativeEventEmitter)
|
|
100
135
|
// =========================================================================
|
|
101
136
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
ON_BANNER_AD_LOADED_EVENT: string;
|
|
105
|
-
ON_BANNER_AD_LOAD_FAILED_EVENT: string;
|
|
106
|
-
ON_BANNER_AD_CLICKED_EVENT: string;
|
|
107
|
-
ON_BANNER_AD_EXPANDED_EVENT: string;
|
|
108
|
-
ON_BANNER_AD_COLLAPSED_EVENT: string;
|
|
109
|
-
ON_BANNER_AD_REVENUE_PAID: string;
|
|
110
|
-
|
|
111
|
-
// MREC events
|
|
112
|
-
ON_MREC_AD_LOADED_EVENT: string;
|
|
113
|
-
ON_MREC_AD_LOAD_FAILED_EVENT: string;
|
|
114
|
-
ON_MREC_AD_CLICKED_EVENT: string;
|
|
115
|
-
ON_MREC_AD_EXPANDED_EVENT: string;
|
|
116
|
-
ON_MREC_AD_COLLAPSED_EVENT: string;
|
|
117
|
-
ON_MREC_AD_REVENUE_PAID: string;
|
|
118
|
-
|
|
119
|
-
// Interstitial events
|
|
120
|
-
ON_INTERSTITIAL_LOADED_EVENT: string;
|
|
121
|
-
ON_INTERSTITIAL_LOAD_FAILED_EVENT: string;
|
|
122
|
-
ON_INTERSTITIAL_CLICKED_EVENT: string;
|
|
123
|
-
ON_INTERSTITIAL_DISPLAYED_EVENT: string;
|
|
124
|
-
ON_INTERSTITIAL_DISPLAY_FAILED_EVENT: string;
|
|
125
|
-
ON_INTERSTITIAL_HIDDEN_EVENT: string;
|
|
126
|
-
ON_INTERSTITIAL_AD_REVENUE_PAID: string;
|
|
127
|
-
|
|
128
|
-
// Rewarded events
|
|
129
|
-
ON_REWARDED_AD_LOADED_EVENT: string;
|
|
130
|
-
ON_REWARDED_AD_LOAD_FAILED_EVENT: string;
|
|
131
|
-
ON_REWARDED_AD_CLICKED_EVENT: string;
|
|
132
|
-
ON_REWARDED_AD_DISPLAYED_EVENT: string;
|
|
133
|
-
ON_REWARDED_AD_DISPLAY_FAILED_EVENT: string;
|
|
134
|
-
ON_REWARDED_AD_HIDDEN_EVENT: string;
|
|
135
|
-
ON_REWARDED_AD_RECEIVED_REWARD_EVENT: string;
|
|
136
|
-
ON_REWARDED_AD_REVENUE_PAID: string;
|
|
137
|
-
|
|
138
|
-
// Position constants
|
|
139
|
-
TOP_LEFT_POSITION: string;
|
|
140
|
-
TOP_CENTER_POSITION: string;
|
|
141
|
-
TOP_RIGHT_POSITION: string;
|
|
142
|
-
CENTER_LEFT_POSITION: string;
|
|
143
|
-
CENTERED_POSITION: string;
|
|
144
|
-
CENTER_RIGHT_POSITION: string;
|
|
145
|
-
BOTTOM_LEFT_POSITION: string;
|
|
146
|
-
BOTTOM_CENTER_POSITION: string;
|
|
147
|
-
BOTTOM_RIGHT_POSITION: string;
|
|
148
|
-
|
|
149
|
-
// Error code constants
|
|
150
|
-
ERROR_CODE_INTERNAL_ERROR: number;
|
|
151
|
-
ERROR_CODE_NETWORK_ERROR: number;
|
|
152
|
-
ERROR_CODE_NETWORK_TIMEOUT: number;
|
|
153
|
-
ERROR_CODE_NO_FILL: number;
|
|
154
|
-
ERROR_CODE_AD_NOT_READY: number;
|
|
155
|
-
ERROR_CODE_AD_ALREADY_SHOWING: number;
|
|
156
|
-
ERROR_CODE_INVALID_AD_UNIT: number;
|
|
157
|
-
ERROR_CODE_NOT_INITIALIZED: number;
|
|
158
|
-
ERROR_CODE_NO_CONNECTION: number;
|
|
159
|
-
};
|
|
137
|
+
addListener(eventName: string): void;
|
|
138
|
+
removeListeners(count: number): void;
|
|
160
139
|
}
|
|
161
140
|
|
|
162
|
-
export default TurboModuleRegistry.getEnforcing<Spec>('
|
|
141
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('CloudX');
|
package/src/types/AdEvent.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Represents any ad event object emitted by the native module.
|
|
3
3
|
*/
|
|
4
|
-
import type {
|
|
4
|
+
import type { CloudXAdInfo, CloudXAdLoadFailedInfo, CloudXAdDisplayFailedInfo, CloudXAdRewardInfo } from './AdInfo';
|
|
5
5
|
|
|
6
|
-
export type
|
|
6
|
+
export type CloudXAdEventObject = CloudXAdInfo | CloudXAdLoadFailedInfo | CloudXAdDisplayFailedInfo | CloudXAdRewardInfo;
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Generic ad event listener callback type.
|
|
10
10
|
*/
|
|
11
|
-
export type
|
|
11
|
+
export type CloudXAdEventListener<T extends CloudXAdEventObject = CloudXAdEventObject> = (event: T) => void;
|
package/src/types/AdInfo.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CloudXErrorCode } from '../CloudXErrorCode';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Represents a successfully loaded ad served by CloudX.
|
|
5
5
|
*/
|
|
6
|
-
export type
|
|
6
|
+
export type CloudXAdInfo = {
|
|
7
7
|
/** The ad unit ID for this ad. */
|
|
8
8
|
adUnitId: string;
|
|
9
9
|
|
|
@@ -26,12 +26,12 @@ export type AdInfo = {
|
|
|
26
26
|
/**
|
|
27
27
|
* Represents a failure when attempting to load an ad.
|
|
28
28
|
*/
|
|
29
|
-
export type
|
|
29
|
+
export type CloudXAdLoadFailedInfo = {
|
|
30
30
|
/** The ad unit ID for which the load failed. */
|
|
31
31
|
adUnitId: string;
|
|
32
32
|
|
|
33
33
|
/** CloudX error code. */
|
|
34
|
-
code:
|
|
34
|
+
code: CloudXErrorCode;
|
|
35
35
|
|
|
36
36
|
/** Descriptive error message. */
|
|
37
37
|
message?: string | null;
|
|
@@ -40,9 +40,9 @@ export type AdLoadFailedInfo = {
|
|
|
40
40
|
/**
|
|
41
41
|
* Represents an error that occurred when displaying an ad.
|
|
42
42
|
*/
|
|
43
|
-
export type
|
|
43
|
+
export type CloudXAdDisplayFailedInfo = CloudXAdInfo & {
|
|
44
44
|
/** CloudX error code. */
|
|
45
|
-
code:
|
|
45
|
+
code: CloudXErrorCode;
|
|
46
46
|
|
|
47
47
|
/** Descriptive error message. */
|
|
48
48
|
message?: string | null;
|
|
@@ -51,7 +51,7 @@ export type AdDisplayFailedInfo = AdInfo & {
|
|
|
51
51
|
/**
|
|
52
52
|
* Represents a successful reward event from a rewarded ad.
|
|
53
53
|
*/
|
|
54
|
-
export type
|
|
54
|
+
export type CloudXAdRewardInfo = CloudXAdInfo & {
|
|
55
55
|
/** The label of the reward. */
|
|
56
56
|
rewardLabel?: string | null;
|
|
57
57
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { CloudXAdInfo, CloudXAdLoadFailedInfo } from './AdInfo';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Base props shared by ad UI components.
|
|
5
|
+
*/
|
|
6
|
+
export type CloudXAdProps = {
|
|
7
|
+
/** The ad unit ID used to load ads. */
|
|
8
|
+
adUnitId: string;
|
|
9
|
+
|
|
10
|
+
/** Placement name for reporting. */
|
|
11
|
+
placement?: string | null;
|
|
12
|
+
|
|
13
|
+
/** Custom data string. */
|
|
14
|
+
customData?: string | null;
|
|
15
|
+
|
|
16
|
+
/** Called when a new ad is successfully loaded. */
|
|
17
|
+
onAdLoaded?: (adInfo: CloudXAdInfo) => void;
|
|
18
|
+
|
|
19
|
+
/** Called when the SDK fails to load a new ad. */
|
|
20
|
+
onAdLoadFailed?: (errorInfo: CloudXAdLoadFailedInfo) => void;
|
|
21
|
+
|
|
22
|
+
/** Called when the ad is clicked by the user. */
|
|
23
|
+
onAdClicked?: (adInfo: CloudXAdInfo) => void;
|
|
24
|
+
|
|
25
|
+
/** Called when ad revenue is paid to the publisher. */
|
|
26
|
+
onAdRevenuePaid?: (adInfo: CloudXAdInfo) => void;
|
|
27
|
+
};
|
package/src/types/BannerAd.ts
CHANGED
|
@@ -1,59 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CloudXViewAdType } from './ViewAd';
|
|
2
|
+
import type { CloudXAdPosition } from '../CloudXAdPosition';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* Banner ad interface.
|
|
6
|
+
* Extends {@link CloudXViewAdType} with banner-specific methods.
|
|
5
7
|
*/
|
|
6
|
-
export type
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
| 'center_left'
|
|
11
|
-
| 'centered'
|
|
12
|
-
| 'center_right'
|
|
13
|
-
| 'bottom_left'
|
|
14
|
-
| 'bottom_center'
|
|
15
|
-
| 'bottom_right';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Programmatic banner ad interface.
|
|
19
|
-
*/
|
|
20
|
-
export type BannerAdType = {
|
|
21
|
-
createAd(adUnitId: string, position: AdViewPositionType): void;
|
|
22
|
-
createAdWithOffsets(adUnitId: string, position: AdViewPositionType, xOffset: number, yOffset: number): void;
|
|
23
|
-
destroyAd(adUnitId: string): void;
|
|
24
|
-
showAd(adUnitId: string): void;
|
|
25
|
-
hideAd(adUnitId: string): void;
|
|
26
|
-
|
|
27
|
-
updatePosition(adUnitId: string, position: AdViewPositionType): void;
|
|
8
|
+
export type CloudXBannerAdType = CloudXViewAdType & {
|
|
9
|
+
createAd(adUnitId: string, position: CloudXAdPosition): void;
|
|
10
|
+
createAdWithOffsets(adUnitId: string, position: CloudXAdPosition, xOffset: number, yOffset: number): void;
|
|
11
|
+
setBackgroundColor(adUnitId: string, hexColorCode: string): void;
|
|
28
12
|
updateOffsets(adUnitId: string, xOffset: number, yOffset: number): void;
|
|
29
|
-
setBackgroundColor(adUnitId: string, hexColorString: string): void;
|
|
30
|
-
|
|
31
|
-
setPlacement(adUnitId: string, placement: string | null): void;
|
|
32
|
-
setCustomData(adUnitId: string, customData: string | null): void;
|
|
33
|
-
|
|
34
|
-
startAutoRefresh(adUnitId: string): void;
|
|
35
|
-
stopAutoRefresh(adUnitId: string): void;
|
|
36
|
-
|
|
37
|
-
addAdLoadedEventListener(listener: (adInfo: AdInfo) => void): void;
|
|
38
|
-
removeAdLoadedEventListener(): void;
|
|
39
|
-
|
|
40
|
-
addAdLoadFailedEventListener(listener: (errorInfo: AdLoadFailedInfo) => void): void;
|
|
41
|
-
removeAdLoadFailedEventListener(): void;
|
|
42
|
-
|
|
43
|
-
addAdClickedEventListener(listener: (adInfo: AdInfo) => void): void;
|
|
44
|
-
removeAdClickedEventListener(): void;
|
|
45
|
-
|
|
46
|
-
addAdExpandedEventListener(listener: (adInfo: AdInfo) => void): void;
|
|
47
|
-
removeAdExpandedEventListener(): void;
|
|
48
|
-
|
|
49
|
-
addAdCollapsedEventListener(listener: (adInfo: AdInfo) => void): void;
|
|
50
|
-
removeAdCollapsedEventListener(): void;
|
|
51
|
-
|
|
52
|
-
addAdRevenuePaidListener(listener: (adInfo: AdInfo) => void): void;
|
|
53
|
-
removeAdRevenuePaidListener(): void;
|
|
54
13
|
};
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* MREC ad type is identical to Banner in terms of API surface.
|
|
58
|
-
*/
|
|
59
|
-
export type MRecAdType = BannerAdType;
|
package/src/types/CloudX.ts
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CloudXInitializationResult } from './Configuration';
|
|
2
|
+
|
|
3
|
+
export type CloudXLogLevelValue = 'verbose' | 'debug' | 'info' | 'warn' | 'error' | 'none';
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* Main CloudX SDK module interface.
|
|
5
7
|
*/
|
|
6
8
|
export type CloudXType = {
|
|
7
|
-
/** Initializes the CloudX SDK with the given app key. */
|
|
8
|
-
initialize(appKey: string): Promise<Configuration>;
|
|
9
|
-
|
|
10
9
|
/** Returns whether the SDK has been initialized. */
|
|
11
10
|
isInitialized(): Promise<boolean>;
|
|
12
11
|
|
|
12
|
+
/** Initializes the CloudX SDK with the given app key. */
|
|
13
|
+
initialize(appKey: string): Promise<CloudXInitializationResult>;
|
|
14
|
+
|
|
15
|
+
/** Checks whether the current device is a tablet. */
|
|
16
|
+
isTablet(): Promise<boolean>;
|
|
17
|
+
|
|
13
18
|
/** Returns the native SDK version string. */
|
|
14
19
|
getVersion(): Promise<string>;
|
|
15
20
|
|
|
16
21
|
/** Sets the minimum log level for CloudX SDK logging. */
|
|
17
|
-
setMinLogLevel(level:
|
|
22
|
+
setMinLogLevel(level: CloudXLogLevelValue): void;
|
|
18
23
|
|
|
19
24
|
/** Sets a hashed user ID for targeting. */
|
|
20
25
|
setHashedUserID(hashedUserID: string): void;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Result object returned after calling `initialize()`.
|
|
3
3
|
*/
|
|
4
|
-
export type
|
|
4
|
+
export type CloudXInitializationResult = {
|
|
5
5
|
/** Whether initialization was successful. */
|
|
6
6
|
success: boolean;
|
|
7
7
|
|
|
8
|
-
/** Optional message with additional details. */
|
|
8
|
+
/** Optional message with additional details, populated on failure. */
|
|
9
9
|
message?: string | null;
|
|
10
10
|
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use `CloudXInitializationResult` instead.
|
|
14
|
+
*/
|
|
15
|
+
export type CloudXConfiguration = CloudXInitializationResult;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CloudXAdDisplayFailedInfo, CloudXAdInfo, CloudXAdLoadFailedInfo } from './AdInfo';
|
|
2
|
+
import type { CloudXAdEventListener } from './AdEvent';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Shared interface for fullscreen ad types (Interstitial, Rewarded).
|
|
5
6
|
*/
|
|
6
|
-
export type
|
|
7
|
+
export type CloudXFullscreenAdType = {
|
|
7
8
|
/** Returns whether an ad is ready to display. */
|
|
8
9
|
isAdReady(adUnitId: string): Promise<boolean>;
|
|
9
10
|
|
|
@@ -16,24 +17,24 @@ export type FullscreenAdType = {
|
|
|
16
17
|
/** Destroys the ad instance and frees resources. */
|
|
17
18
|
destroyAd(adUnitId: string): void;
|
|
18
19
|
|
|
19
|
-
addAdLoadedEventListener(listener:
|
|
20
|
+
addAdLoadedEventListener(listener: CloudXAdEventListener<CloudXAdInfo>): void;
|
|
20
21
|
removeAdLoadedEventListener(): void;
|
|
21
22
|
|
|
22
|
-
addAdLoadFailedEventListener(listener:
|
|
23
|
+
addAdLoadFailedEventListener(listener: CloudXAdEventListener<CloudXAdLoadFailedInfo>): void;
|
|
23
24
|
removeAdLoadFailedEventListener(): void;
|
|
24
25
|
|
|
25
|
-
addAdClickedEventListener(listener:
|
|
26
|
+
addAdClickedEventListener(listener: CloudXAdEventListener<CloudXAdInfo>): void;
|
|
26
27
|
removeAdClickedEventListener(): void;
|
|
27
28
|
|
|
28
|
-
addAdDisplayedEventListener(listener:
|
|
29
|
+
addAdDisplayedEventListener(listener: CloudXAdEventListener<CloudXAdInfo>): void;
|
|
29
30
|
removeAdDisplayedEventListener(): void;
|
|
30
31
|
|
|
31
|
-
addAdFailedToDisplayEventListener(listener:
|
|
32
|
+
addAdFailedToDisplayEventListener(listener: CloudXAdEventListener<CloudXAdDisplayFailedInfo>): void;
|
|
32
33
|
removeAdFailedToDisplayEventListener(): void;
|
|
33
34
|
|
|
34
|
-
addAdHiddenEventListener(listener:
|
|
35
|
+
addAdHiddenEventListener(listener: CloudXAdEventListener<CloudXAdInfo>): void;
|
|
35
36
|
removeAdHiddenEventListener(): void;
|
|
36
37
|
|
|
37
|
-
addAdRevenuePaidListener(listener:
|
|
38
|
+
addAdRevenuePaidListener(listener: CloudXAdEventListener<CloudXAdInfo>): void;
|
|
38
39
|
removeAdRevenuePaidListener(): void;
|
|
39
40
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CloudXFullscreenAdType } from './FullscreenAd';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Interstitial ad type — identical to the fullscreen ad interface.
|
|
5
|
+
* Provides a named type for consumers and a place to add interstitial-specific
|
|
6
|
+
* methods in the future without refactoring.
|
|
7
|
+
*/
|
|
8
|
+
export type CloudXInterstitialAdType = CloudXFullscreenAdType;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CloudXViewAdType } from './ViewAd';
|
|
2
|
+
import type { CloudXAdPosition } from '../CloudXAdPosition';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* MREC ad interface.
|
|
6
|
+
* Extends {@link CloudXViewAdType} with MREC-specific methods.
|
|
7
|
+
*/
|
|
8
|
+
export type CloudXMRECAdType = CloudXViewAdType & {
|
|
9
|
+
createAd(adUnitId: string, position: CloudXAdPosition): void;
|
|
10
|
+
createAdWithOffsets(adUnitId: string, position: CloudXAdPosition, xOffset: number, yOffset: number): void;
|
|
11
|
+
setBackgroundColor(adUnitId: string, hexColorCode: string): void;
|
|
12
|
+
updateOffsets(adUnitId: string, xOffset: number, yOffset: number): void;
|
|
13
|
+
};
|
package/src/types/RewardedAd.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { CloudXAdRewardInfo } from './AdInfo';
|
|
2
|
+
import type { CloudXAdEventListener } from './AdEvent';
|
|
3
|
+
import type { CloudXFullscreenAdType } from './FullscreenAd';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Rewarded ad interface, extending fullscreen ad with reward listener.
|
|
6
7
|
*/
|
|
7
|
-
export type
|
|
8
|
-
addAdReceivedRewardEventListener(listener:
|
|
8
|
+
export type CloudXRewardedAdType = CloudXFullscreenAdType & {
|
|
9
|
+
addAdReceivedRewardEventListener(listener: CloudXAdEventListener<CloudXAdRewardInfo>): void;
|
|
9
10
|
removeAdReceivedRewardEventListener(): void;
|
|
10
11
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { CloudXAdInfo, CloudXAdLoadFailedInfo } from './AdInfo';
|
|
2
|
+
import type { CloudXAdEventListener } from './AdEvent';
|
|
3
|
+
import type { CloudXAdPosition } from '../CloudXAdPosition';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Shared interface for view-based ads (Banners and MRECs).
|
|
7
|
+
*/
|
|
8
|
+
export type CloudXViewAdType = {
|
|
9
|
+
destroyAd(adUnitId: string): void;
|
|
10
|
+
showAd(adUnitId: string): void;
|
|
11
|
+
hideAd(adUnitId: string): void;
|
|
12
|
+
|
|
13
|
+
setPlacement(adUnitId: string, placement: string | null): void;
|
|
14
|
+
setCustomData(adUnitId: string, customData: string | null): void;
|
|
15
|
+
|
|
16
|
+
updatePosition(adUnitId: string, bannerPosition: CloudXAdPosition): void;
|
|
17
|
+
|
|
18
|
+
startAutoRefresh(adUnitId: string): void;
|
|
19
|
+
stopAutoRefresh(adUnitId: string): void;
|
|
20
|
+
|
|
21
|
+
addAdLoadedEventListener(listener: CloudXAdEventListener<CloudXAdInfo>): void;
|
|
22
|
+
removeAdLoadedEventListener(): void;
|
|
23
|
+
|
|
24
|
+
addAdLoadFailedEventListener(listener: CloudXAdEventListener<CloudXAdLoadFailedInfo>): void;
|
|
25
|
+
removeAdLoadFailedEventListener(): void;
|
|
26
|
+
|
|
27
|
+
addAdClickedEventListener(listener: CloudXAdEventListener<CloudXAdInfo>): void;
|
|
28
|
+
removeAdClickedEventListener(): void;
|
|
29
|
+
|
|
30
|
+
addAdExpandedEventListener(listener: CloudXAdEventListener<CloudXAdInfo>): void;
|
|
31
|
+
removeAdExpandedEventListener(): void;
|
|
32
|
+
|
|
33
|
+
addAdCollapsedEventListener(listener: CloudXAdEventListener<CloudXAdInfo>): void;
|
|
34
|
+
removeAdCollapsedEventListener(): void;
|
|
35
|
+
|
|
36
|
+
addAdRevenuePaidListener(listener: CloudXAdEventListener<CloudXAdInfo>): void;
|
|
37
|
+
removeAdRevenuePaidListener(): void;
|
|
38
|
+
};
|
package/src/types/index.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
export type {
|
|
3
|
-
export type { CloudXType } from './CloudX';
|
|
4
|
-
export type {
|
|
5
|
-
export type {
|
|
6
|
-
export type {
|
|
7
|
-
export type {
|
|
1
|
+
export type { CloudXAdInfo, CloudXAdLoadFailedInfo, CloudXAdDisplayFailedInfo, CloudXAdRewardInfo } from './AdInfo';
|
|
2
|
+
export type { CloudXInitializationResult, CloudXConfiguration } from './Configuration';
|
|
3
|
+
export type { CloudXType, CloudXLogLevelValue } from './CloudX';
|
|
4
|
+
export type { CloudXFullscreenAdType } from './FullscreenAd';
|
|
5
|
+
export type { CloudXInterstitialAdType } from './InterstitialAd';
|
|
6
|
+
export type { CloudXRewardedAdType } from './RewardedAd';
|
|
7
|
+
export type { CloudXViewAdType } from './ViewAd';
|
|
8
|
+
export type { CloudXBannerAdType } from './BannerAd';
|
|
9
|
+
export type { CloudXMRECAdType } from './MRECAd';
|
|
10
|
+
export type { CloudXAdProps } from './AdProps';
|
|
11
|
+
export type { CloudXAdEventObject, CloudXAdEventListener } from './AdEvent';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
package com.cloudxreactnative
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.bridge.WritableMap
|
|
4
|
-
import com.facebook.react.uimanager.events.Event
|
|
5
|
-
|
|
6
|
-
class CloudXAdViewEvent(
|
|
7
|
-
surfaceId: Int,
|
|
8
|
-
viewId: Int,
|
|
9
|
-
private val name: String,
|
|
10
|
-
private val payload: WritableMap?
|
|
11
|
-
) : Event<CloudXAdViewEvent>(surfaceId, viewId) {
|
|
12
|
-
override fun getEventName(): String = name
|
|
13
|
-
override fun canCoalesce(): Boolean = false
|
|
14
|
-
override fun getEventData(): WritableMap? = payload
|
|
15
|
-
}
|