cloudx-react-native 3.4.6 → 3.6.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.
Files changed (114) hide show
  1. package/android/build.gradle +1 -1
  2. package/android/src/main/java/com/cloudxreactnative/CloudXAdEvents.kt +16 -0
  3. package/android/src/main/java/com/cloudxreactnative/CloudXAdInfo.kt +14 -0
  4. package/android/src/main/java/com/cloudxreactnative/CloudXAdView.kt +238 -0
  5. package/android/src/main/java/com/cloudxreactnative/CloudXAdViewEvent.kt +28 -0
  6. package/android/src/main/java/com/cloudxreactnative/CloudXAdViewManagerImpl.kt +54 -0
  7. package/android/src/main/java/com/cloudxreactnative/CloudXExtraParameters.kt +101 -0
  8. package/android/src/main/java/com/cloudxreactnative/CloudXModuleImpl.kt +171 -57
  9. package/android/src/main/java/com/cloudxreactnative/CloudXPackage.kt +1 -1
  10. package/android/src/newarch/com/cloudxreactnative/CloudXAdViewManager.kt +52 -0
  11. package/android/src/newarch/com/cloudxreactnative/CloudXModule.kt +7 -0
  12. package/android/src/oldarch/com/cloudxreactnative/CloudXAdViewManager.kt +46 -0
  13. package/android/src/oldarch/com/cloudxreactnative/CloudXModule.kt +7 -0
  14. package/cloudx-react-native.podspec +3 -3
  15. package/ios/CloudX.h +2 -2
  16. package/ios/CloudX.mm +268 -62
  17. package/ios/CloudXAdView.h +33 -0
  18. package/ios/CloudXAdView.mm +500 -0
  19. package/ios/CloudXAdViewManager.h +12 -0
  20. package/ios/CloudXAdViewManager.mm +38 -0
  21. package/ios/CloudXExtraParameters.h +27 -0
  22. package/ios/CloudXExtraParameters.mm +117 -0
  23. package/lib/commonjs/CloudX.js +5 -1
  24. package/lib/commonjs/CloudX.js.map +1 -1
  25. package/lib/commonjs/CloudXAdViewBase.js +250 -0
  26. package/lib/commonjs/CloudXAdViewBase.js.map +1 -0
  27. package/lib/commonjs/CloudXAppOpenAd.js +98 -0
  28. package/lib/commonjs/CloudXAppOpenAd.js.map +1 -0
  29. package/lib/commonjs/CloudXBannerView.js +27 -0
  30. package/lib/commonjs/CloudXBannerView.js.map +1 -0
  31. package/lib/commonjs/CloudXMRECView.js +27 -0
  32. package/lib/commonjs/CloudXMRECView.js.map +1 -0
  33. package/lib/commonjs/hooks.js +81 -0
  34. package/lib/commonjs/hooks.js.map +1 -1
  35. package/lib/commonjs/index.js +53 -0
  36. package/lib/commonjs/index.js.map +1 -1
  37. package/lib/commonjs/specs/CloudXAdViewNativeComponent.js +30 -0
  38. package/lib/commonjs/specs/CloudXAdViewNativeComponent.js.map +1 -0
  39. package/lib/commonjs/specs/NativeCloudX.js.map +1 -1
  40. package/lib/commonjs/types/AppOpenAd.js +6 -0
  41. package/lib/commonjs/types/AppOpenAd.js.map +1 -0
  42. package/lib/commonjs/types/RevenueData.js +21 -0
  43. package/lib/commonjs/types/RevenueData.js.map +1 -0
  44. package/lib/commonjs/types/index.js +17 -0
  45. package/lib/commonjs/types/index.js.map +1 -1
  46. package/lib/commonjs/version.js +1 -1
  47. package/lib/module/CloudX.js +5 -1
  48. package/lib/module/CloudX.js.map +1 -1
  49. package/lib/module/CloudXAdViewBase.js +242 -0
  50. package/lib/module/CloudXAdViewBase.js.map +1 -0
  51. package/lib/module/CloudXAppOpenAd.js +91 -0
  52. package/lib/module/CloudXAppOpenAd.js.map +1 -0
  53. package/lib/module/CloudXBannerView.js +19 -0
  54. package/lib/module/CloudXBannerView.js.map +1 -0
  55. package/lib/module/CloudXMRECView.js +19 -0
  56. package/lib/module/CloudXMRECView.js.map +1 -0
  57. package/lib/module/hooks.js +80 -0
  58. package/lib/module/hooks.js.map +1 -1
  59. package/lib/module/index.js +10 -1
  60. package/lib/module/index.js.map +1 -1
  61. package/lib/module/specs/CloudXAdViewNativeComponent.js +27 -0
  62. package/lib/module/specs/CloudXAdViewNativeComponent.js.map +1 -0
  63. package/lib/module/specs/NativeCloudX.js.map +1 -1
  64. package/lib/module/types/AppOpenAd.js +2 -0
  65. package/lib/module/types/AppOpenAd.js.map +1 -0
  66. package/lib/module/types/RevenueData.js +15 -0
  67. package/lib/module/types/RevenueData.js.map +1 -0
  68. package/lib/module/types/index.js +1 -1
  69. package/lib/module/types/index.js.map +1 -1
  70. package/lib/module/version.js +1 -1
  71. package/lib/typescript/src/CloudX.d.ts.map +1 -1
  72. package/lib/typescript/src/CloudXAdViewBase.d.ts +28 -0
  73. package/lib/typescript/src/CloudXAdViewBase.d.ts.map +1 -0
  74. package/lib/typescript/src/CloudXAppOpenAd.d.ts +4 -0
  75. package/lib/typescript/src/CloudXAppOpenAd.d.ts.map +1 -0
  76. package/lib/typescript/src/CloudXBannerView.d.ts +16 -0
  77. package/lib/typescript/src/CloudXBannerView.d.ts.map +1 -0
  78. package/lib/typescript/src/CloudXMRECView.d.ts +16 -0
  79. package/lib/typescript/src/CloudXMRECView.d.ts.map +1 -0
  80. package/lib/typescript/src/hooks.d.ts +14 -0
  81. package/lib/typescript/src/hooks.d.ts.map +1 -1
  82. package/lib/typescript/src/index.d.ts +9 -3
  83. package/lib/typescript/src/index.d.ts.map +1 -1
  84. package/lib/typescript/src/specs/CloudXAdViewNativeComponent.d.ts +62 -0
  85. package/lib/typescript/src/specs/CloudXAdViewNativeComponent.d.ts.map +1 -0
  86. package/lib/typescript/src/specs/NativeCloudX.d.ts +13 -0
  87. package/lib/typescript/src/specs/NativeCloudX.d.ts.map +1 -1
  88. package/lib/typescript/src/types/AdProps.d.ts +3 -0
  89. package/lib/typescript/src/types/AdProps.d.ts.map +1 -1
  90. package/lib/typescript/src/types/AppOpenAd.d.ts +8 -0
  91. package/lib/typescript/src/types/AppOpenAd.d.ts.map +1 -0
  92. package/lib/typescript/src/types/CloudX.d.ts +6 -0
  93. package/lib/typescript/src/types/CloudX.d.ts.map +1 -1
  94. package/lib/typescript/src/types/RevenueData.d.ts +32 -0
  95. package/lib/typescript/src/types/RevenueData.d.ts.map +1 -0
  96. package/lib/typescript/src/types/index.d.ts +3 -0
  97. package/lib/typescript/src/types/index.d.ts.map +1 -1
  98. package/lib/typescript/src/version.d.ts +1 -1
  99. package/package.json +6 -2
  100. package/src/CloudX.ts +6 -0
  101. package/src/CloudXAdViewBase.tsx +294 -0
  102. package/src/CloudXAppOpenAd.ts +109 -0
  103. package/src/CloudXBannerView.tsx +20 -0
  104. package/src/CloudXMRECView.tsx +20 -0
  105. package/src/hooks.ts +103 -0
  106. package/src/index.ts +22 -2
  107. package/src/specs/CloudXAdViewNativeComponent.ts +84 -0
  108. package/src/specs/NativeCloudX.ts +22 -0
  109. package/src/types/AdProps.ts +4 -0
  110. package/src/types/AppOpenAd.ts +8 -0
  111. package/src/types/CloudX.ts +7 -0
  112. package/src/types/RevenueData.ts +39 -0
  113. package/src/types/index.ts +3 -0
  114. package/src/version.ts +1 -1
package/src/hooks.ts CHANGED
@@ -15,6 +15,10 @@ const {
15
15
  ON_INTERSTITIAL_LOAD_FAILED_EVENT,
16
16
  ON_INTERSTITIAL_DISPLAY_FAILED_EVENT,
17
17
  ON_INTERSTITIAL_HIDDEN_EVENT,
18
+ ON_APPOPEN_LOADED_EVENT,
19
+ ON_APPOPEN_LOAD_FAILED_EVENT,
20
+ ON_APPOPEN_DISPLAY_FAILED_EVENT,
21
+ ON_APPOPEN_HIDDEN_EVENT,
18
22
  ON_REWARDED_AD_LOADED_EVENT,
19
23
  ON_REWARDED_AD_LOAD_FAILED_EVENT,
20
24
  ON_REWARDED_AD_DISPLAY_FAILED_EVENT,
@@ -123,6 +127,105 @@ export function useCloudXInterstitial(adUnitId: string): CloudXInterstitialHookR
123
127
  return { isLoaded, isLoading, error, load, show, destroy };
124
128
  }
125
129
 
130
+ // ---------------------------------------------------------------------------
131
+ // useCloudXAppOpen
132
+ // ---------------------------------------------------------------------------
133
+
134
+ export type CloudXAppOpenHookResult = {
135
+ isLoaded: boolean;
136
+ isLoading: boolean;
137
+ error: string | null;
138
+ load: () => void;
139
+ show: (placement?: string | null, customData?: string | null) => void;
140
+ destroy: () => void;
141
+ };
142
+
143
+ /**
144
+ * Hook for managing an app open ad lifecycle.
145
+ *
146
+ * @param adUnitId - The ad unit identifier.
147
+ */
148
+ export function useCloudXAppOpen(adUnitId: string): CloudXAppOpenHookResult {
149
+ const [isLoaded, setIsLoaded] = useState(false);
150
+ const [isLoading, setIsLoading] = useState(false);
151
+ const [error, setError] = useState<string | null>(null);
152
+ const mountedRef = useRef(true);
153
+
154
+ useEffect(() => {
155
+ mountedRef.current = true;
156
+ const subs: EventSubscription[] = [];
157
+
158
+ subs.push(
159
+ emitter.addListener(ON_APPOPEN_LOADED_EVENT, (event: { adUnitId: string }) => {
160
+ if (event.adUnitId === adUnitId && mountedRef.current) {
161
+ setIsLoaded(true);
162
+ setIsLoading(false);
163
+ setError(null);
164
+ }
165
+ }),
166
+ );
167
+
168
+ subs.push(
169
+ emitter.addListener(ON_APPOPEN_LOAD_FAILED_EVENT, (event: { adUnitId: string; message?: string }) => {
170
+ if (event.adUnitId === adUnitId && mountedRef.current) {
171
+ setIsLoaded(false);
172
+ setIsLoading(false);
173
+ setError(event.message ?? 'Failed to load');
174
+ }
175
+ }),
176
+ );
177
+
178
+ subs.push(
179
+ emitter.addListener(ON_APPOPEN_DISPLAY_FAILED_EVENT, (event: { adUnitId: string; message?: string }) => {
180
+ if (event.adUnitId === adUnitId && mountedRef.current) {
181
+ setIsLoaded(false);
182
+ setError(event.message ?? 'Display failed');
183
+ }
184
+ }),
185
+ );
186
+
187
+ subs.push(
188
+ emitter.addListener(ON_APPOPEN_HIDDEN_EVENT, (event: { adUnitId: string }) => {
189
+ if (event.adUnitId === adUnitId && mountedRef.current) {
190
+ setIsLoaded(false);
191
+ }
192
+ }),
193
+ );
194
+
195
+ return () => {
196
+ mountedRef.current = false;
197
+ subs.forEach((s) => s.remove());
198
+ NativeCloudX.destroyAppOpen(adUnitId);
199
+ };
200
+ }, [adUnitId]);
201
+
202
+ const load = useCallback(() => {
203
+ setIsLoading(true);
204
+ setError(null);
205
+ NativeCloudX.loadAppOpen(adUnitId);
206
+ }, [adUnitId]);
207
+
208
+ const show = useCallback(
209
+ (placement?: string | null, customData?: string | null) => {
210
+ if (!isLoaded) {
211
+ setError('Ad not loaded');
212
+ return;
213
+ }
214
+ NativeCloudX.showAppOpen(adUnitId, placement ?? undefined, customData ?? undefined);
215
+ },
216
+ [adUnitId, isLoaded],
217
+ );
218
+
219
+ const destroy = useCallback(() => {
220
+ NativeCloudX.destroyAppOpen(adUnitId);
221
+ setIsLoaded(false);
222
+ setIsLoading(false);
223
+ setError(null);
224
+ }, [adUnitId]);
225
+
226
+ return { isLoaded, isLoading, error, load, show, destroy };
227
+ }
228
+
126
229
  // ---------------------------------------------------------------------------
127
230
  // useCloudXRewarded
128
231
  // ---------------------------------------------------------------------------
package/src/index.ts CHANGED
@@ -1,15 +1,26 @@
1
1
  // Core SDK
2
2
  export { default, CloudX } from './CloudX';
3
3
  export { default as NativeCloudX } from './specs/NativeCloudX';
4
+ // The shared NativeEventEmitter every hook subscribes through. Consumers
5
+ // that need raw event access (e.g. logging) should use this instance rather
6
+ // than constructing their own NativeEventEmitter(NativeCloudX).
7
+ export { emitter as cloudXEventEmitter } from './EventEmitter';
4
8
  export { CloudXArbiterBid } from './types/Arbiter';
9
+ export { CloudXRevenuePlatform, CloudXRevenuePrecision } from './types/RevenueData';
5
10
 
6
11
  // Ad Modules
7
12
  export { CloudXInterstitialAd } from './CloudXInterstitialAd';
13
+ export { CloudXAppOpenAd } from './CloudXAppOpenAd';
8
14
  export { CloudXRewardedAd } from './CloudXRewardedAd';
9
15
  export { CloudXBannerAd } from './CloudXBannerAd';
10
16
  export { CloudXMRECAd } from './CloudXMRECAd';
11
17
  export { CloudXAdPosition } from './CloudXAdPosition';
12
18
 
19
+ // Ad View Components (in-tree; layer correctly under app overlays)
20
+ export { CloudXBannerView } from './CloudXBannerView';
21
+ export { CloudXMRECView } from './CloudXMRECView';
22
+ export type { CloudXAdViewProps, CloudXAdViewFormat } from './CloudXAdViewBase';
23
+
13
24
  // Error Codes
14
25
  export { CloudXErrorCode } from './CloudXErrorCode';
15
26
 
@@ -17,8 +28,13 @@ export { CloudXErrorCode } from './CloudXErrorCode';
17
28
  export { requestTrackingAuthorization, getTrackingAuthorizationStatus, CloudXATTStatus } from './AppTrackingTransparency';
18
29
 
19
30
  // Hooks
20
- export { useCloudXInterstitial, useCloudXRewarded, useCloudXBanner } from './hooks';
21
- export type { CloudXInterstitialHookResult, CloudXRewardedHookResult, CloudXBannerHookResult } from './hooks';
31
+ export { useCloudXInterstitial, useCloudXAppOpen, useCloudXRewarded, useCloudXBanner } from './hooks';
32
+ export type {
33
+ CloudXInterstitialHookResult,
34
+ CloudXAppOpenHookResult,
35
+ CloudXRewardedHookResult,
36
+ CloudXBannerHookResult,
37
+ } from './hooks';
22
38
 
23
39
  // Types
24
40
  export type {
@@ -36,8 +52,12 @@ export type {
36
52
  CloudXSDKArbiterBid,
37
53
  CloudXLevelPlayArbiterBid,
38
54
  CloudXPubMaticArbiterBid,
55
+ CloudXRevenueData,
56
+ CloudXRevenuePlatformValue,
57
+ CloudXRevenuePrecisionValue,
39
58
  CloudXFullscreenAdType,
40
59
  CloudXInterstitialAdType,
60
+ CloudXAppOpenAdType,
41
61
  CloudXRewardedAdType,
42
62
  CloudXViewAdType,
43
63
  CloudXBannerAdType,
@@ -0,0 +1,84 @@
1
+ import type { HostComponent, ViewProps } from 'react-native';
2
+ import type {
3
+ Double,
4
+ DirectEventHandler,
5
+ UnsafeMixed,
6
+ } from 'react-native/Libraries/Types/CodegenTypes';
7
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
8
+
9
+ /**
10
+ * Payload for ad lifecycle events (load, click, revenue).
11
+ *
12
+ * Codegen cannot express `Record<string, string>`, so the SDK-owned ad values
13
+ * are delivered as a JSON-encoded string in `adValuesJson` and re-parsed into a
14
+ * map by the JS wrapper before surfacing a CloudXAdInfo to the publisher.
15
+ */
16
+ export type CloudXAdInfoEvent = Readonly<{
17
+ adUnitId: string;
18
+ adFormat: string;
19
+ networkName: string;
20
+ networkPlacement?: string | null;
21
+ placement?: string | null;
22
+ revenue: Double;
23
+ adValuesJson?: string | null;
24
+ }>;
25
+
26
+ /**
27
+ * Payload for ad load-failure events.
28
+ */
29
+ export type CloudXAdLoadFailedEvent = Readonly<{
30
+ adUnitId: string;
31
+ code: Double;
32
+ message?: string | null;
33
+ }>;
34
+
35
+ export type NativeExtraParameterEntry = Readonly<{
36
+ key: string;
37
+ value: UnsafeMixed;
38
+ }>;
39
+
40
+ /**
41
+ * Props for the native CloudXAdView component (banner + MREC).
42
+ *
43
+ * This is the in-tree view component: the ad renders as an ordinary React
44
+ * Native view, so publisher overlays (toasts, modals) layer above it via
45
+ * normal RN z-ordering — unlike the imperative overlay banner API.
46
+ */
47
+ export interface NativeProps extends ViewProps {
48
+ /** Ad unit ID used to load the ad. */
49
+ adUnitId: string;
50
+
51
+ /*
52
+ * Ad format: "BANNER" or "MREC". Typed as a plain string because codegen
53
+ * cannot express union literals ('BANNER' | 'MREC') on native props; the
54
+ * literal type is enforced upstream at the wrapper layer (CloudXAdViewBase /
55
+ * CloudXBannerView / CloudXMRECView).
56
+ */
57
+ adFormat: string;
58
+
59
+ /** Optional placement name for reporting. */
60
+ placement?: string | null;
61
+
62
+ /** Optional custom data string. */
63
+ customData?: string | null;
64
+
65
+ /** Extra parameters applied to the underlying ad view. */
66
+ extraParameters: ReadonlyArray<NativeExtraParameterEntry>;
67
+
68
+ /** Called when an ad is successfully loaded. */
69
+ onAdLoadedEvent: DirectEventHandler<CloudXAdInfoEvent>;
70
+
71
+ /** Called when the SDK fails to load an ad. */
72
+ onAdLoadFailedEvent: DirectEventHandler<CloudXAdLoadFailedEvent>;
73
+
74
+ /** Called when the ad is clicked. */
75
+ onAdClickedEvent: DirectEventHandler<CloudXAdInfoEvent>;
76
+
77
+ /** Called when ad revenue is paid. */
78
+ onAdRevenuePaidEvent: DirectEventHandler<CloudXAdInfoEvent>;
79
+ }
80
+
81
+ /**
82
+ * Native in-tree view component backing CloudXBannerView / CloudXMRECView.
83
+ */
84
+ export default codegenNativeComponent<NativeProps>('CloudXAdView') as HostComponent<NativeProps>;
@@ -52,6 +52,15 @@ export interface Spec extends TurboModule {
52
52
  ON_REWARDED_AD_HIDDEN_EVENT: string;
53
53
  ON_REWARDED_AD_RECEIVED_REWARD_EVENT: string;
54
54
  ON_REWARDED_AD_REVENUE_PAID: string;
55
+
56
+ // App Open events
57
+ ON_APPOPEN_LOADED_EVENT: string;
58
+ ON_APPOPEN_LOAD_FAILED_EVENT: string;
59
+ ON_APPOPEN_CLICKED_EVENT: string;
60
+ ON_APPOPEN_DISPLAYED_EVENT: string;
61
+ ON_APPOPEN_DISPLAY_FAILED_EVENT: string;
62
+ ON_APPOPEN_HIDDEN_EVENT: string;
63
+ ON_APPOPEN_AD_REVENUE_PAID: string;
55
64
  };
56
65
 
57
66
  // =========================================================================
@@ -92,6 +101,9 @@ export interface Spec extends TurboModule {
92
101
 
93
102
  arbiter(configuration: UnsafeObject): Promise<UnsafeObject>;
94
103
 
104
+ // Revenue Data
105
+ reportRevenueData(data: UnsafeObject): Promise<boolean>;
106
+
95
107
  // =========================================================================
96
108
  // Banner (Programmatic)
97
109
  // =========================================================================
@@ -148,6 +160,16 @@ export interface Spec extends TurboModule {
148
160
  showRewarded(adUnitId: string, placement?: string | null, customData?: string | null): void;
149
161
  destroyRewarded(adUnitId: string): void;
150
162
 
163
+ // =========================================================================
164
+ // App Open
165
+ // =========================================================================
166
+
167
+ loadAppOpen(adUnitId: string): void;
168
+ setAppOpenExtraParameters(adUnitId: string, extraParameters: UnsafeObject): void;
169
+ isAppOpenReady(adUnitId: string): Promise<boolean>;
170
+ showAppOpen(adUnitId: string, placement?: string | null, customData?: string | null): void;
171
+ destroyAppOpen(adUnitId: string): void;
172
+
151
173
  // =========================================================================
152
174
  // Event Emitter (required by NativeEventEmitter)
153
175
  // =========================================================================
@@ -1,4 +1,5 @@
1
1
  import type { CloudXAdInfo, CloudXAdLoadFailedInfo } from './AdInfo';
2
+ import type { CloudXExtraParameters } from './ExtraParameters';
2
3
 
3
4
  /**
4
5
  * Base props shared by ad UI components.
@@ -13,6 +14,9 @@ export type CloudXAdProps = {
13
14
  /** Custom data string. */
14
15
  customData?: string | null;
15
16
 
17
+ /** Extra parameters applied to the underlying ad view. */
18
+ extraParameters?: CloudXExtraParameters | null;
19
+
16
20
  /** Called when a new ad is successfully loaded. */
17
21
  onAdLoaded?: (adInfo: CloudXAdInfo) => void;
18
22
 
@@ -0,0 +1,8 @@
1
+ import type { CloudXFullscreenAdType } from './FullscreenAd';
2
+
3
+ /**
4
+ * App Open ad type — identical to the fullscreen ad interface.
5
+ * Provides a named type for consumers and a place to add app-open-specific
6
+ * methods in the future without refactoring.
7
+ */
8
+ export type CloudXAppOpenAdType = CloudXFullscreenAdType;
@@ -1,5 +1,6 @@
1
1
  import type { CloudXInitializationResult } from './Configuration';
2
2
  import type { CloudXArbiterConfiguration, CloudXArbiterResult } from './Arbiter';
3
+ import type { CloudXRevenueData } from './RevenueData';
3
4
 
4
5
  export type CloudXLogLevelValue = 'verbose' | 'debug' | 'info' | 'warn' | 'error' | 'none';
5
6
 
@@ -57,4 +58,10 @@ export type CloudXType = {
57
58
 
58
59
  /** Runs CloudX Arbiter using bid data passed through to the native SDK. */
59
60
  arbiter(configuration: CloudXArbiterConfiguration): Promise<CloudXArbiterResult>;
61
+
62
+ /**
63
+ * Reports publisher-observed revenue data.
64
+ * Resolves false when unsupported, invalid, or rejected.
65
+ */
66
+ reportRevenueData(data: CloudXRevenueData): Promise<boolean>;
60
67
  };
@@ -0,0 +1,39 @@
1
+ export type CloudXRevenuePlatformValue = string;
2
+
3
+ export const CloudXRevenuePlatform = {
4
+ ADMOB: 'AdMob',
5
+ /*
6
+ * InMobi does not provide a React Native SDK.
7
+ * INMOBI: 'InMobi',
8
+ */
9
+ custom: (name: string): CloudXRevenuePlatformValue => name.trim(),
10
+ } as const;
11
+
12
+ export const CloudXRevenuePrecision = {
13
+ EXACT: 'exact',
14
+ ESTIMATED: 'estimated',
15
+ PUBLISHER_DEFINED: 'publisher_defined',
16
+ UNDEFINED: 'undefined',
17
+ } as const;
18
+
19
+ export type CloudXRevenuePrecisionValue = (typeof CloudXRevenuePrecision)[keyof typeof CloudXRevenuePrecision];
20
+
21
+ export type CloudXRevenueData = {
22
+ platform: CloudXRevenuePlatformValue;
23
+ /**
24
+ * Revenue for this impression in `currencyCode` units, not micros.
25
+ *
26
+ * Example: pass `1.234` for USD 1.234, not `1234000`.
27
+ */
28
+ revenue: number;
29
+ adFormat: string;
30
+ currencyCode?: string | null;
31
+ precision?: CloudXRevenuePrecisionValue | null;
32
+ networkName?: string | null;
33
+ adUnitId?: string | null;
34
+ thirdPartyAdPlacementId?: string | null;
35
+ creativeId?: string | null;
36
+ networkPlacement?: string | null;
37
+ countryCode?: string | null;
38
+ userSegment?: string | null;
39
+ };
@@ -10,8 +10,11 @@ export type {
10
10
  CloudXLevelPlayArbiterBid,
11
11
  CloudXPubMaticArbiterBid,
12
12
  } from './Arbiter';
13
+ export { CloudXRevenuePlatform, CloudXRevenuePrecision } from './RevenueData';
14
+ export type { CloudXRevenueData, CloudXRevenuePlatformValue, CloudXRevenuePrecisionValue } from './RevenueData';
13
15
  export type { CloudXFullscreenAdType } from './FullscreenAd';
14
16
  export type { CloudXInterstitialAdType } from './InterstitialAd';
17
+ export type { CloudXAppOpenAdType } from './AppOpenAd';
15
18
  export type { CloudXRewardedAdType } from './RewardedAd';
16
19
  export type { CloudXViewAdType } from './ViewAd';
17
20
  export type { CloudXBannerAdType } from './BannerAd';
package/src/version.ts CHANGED
@@ -3,4 +3,4 @@
3
3
  // This value is reported to the native SDK in CloudX.initialize() and is used
4
4
  // for wrapper-version telemetry/attribution, so a stale value mis-attributes
5
5
  // installs to the wrong release.
6
- export const PLUGIN_VERSION = '3.4.6';
6
+ export const PLUGIN_VERSION = '3.6.0';