cloudx-react-native 3.4.7 → 3.6.1

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 (102) hide show
  1. package/android/build.gradle +1 -1
  2. package/android/src/main/java/com/cloudxreactnative/CloudXAdEvents.kt +11 -5
  3. package/android/src/main/java/com/cloudxreactnative/CloudXAdInfo.kt +14 -0
  4. package/android/src/main/java/com/cloudxreactnative/CloudXAdView.kt +9 -15
  5. package/android/src/main/java/com/cloudxreactnative/CloudXAdViewEvent.kt +1 -1
  6. package/android/src/main/java/com/cloudxreactnative/CloudXModuleImpl.kt +202 -0
  7. package/android/src/newarch/com/cloudxreactnative/CloudXModule.kt +7 -0
  8. package/android/src/oldarch/com/cloudxreactnative/CloudXModule.kt +7 -0
  9. package/cloudx-react-native.podspec +3 -3
  10. package/ios/CloudX.h +2 -2
  11. package/ios/CloudX.mm +284 -9
  12. package/ios/CloudXAdView.h +10 -12
  13. package/ios/CloudXAdView.mm +10 -15
  14. package/ios/CloudXAdViewManager.h +6 -6
  15. package/ios/CloudXAdViewManager.mm +4 -4
  16. package/lib/commonjs/CloudX.js +5 -1
  17. package/lib/commonjs/CloudX.js.map +1 -1
  18. package/lib/commonjs/CloudXAdViewBase.js +11 -9
  19. package/lib/commonjs/CloudXAdViewBase.js.map +1 -1
  20. package/lib/commonjs/CloudXAppOpenAd.js +98 -0
  21. package/lib/commonjs/CloudXAppOpenAd.js.map +1 -0
  22. package/lib/commonjs/CloudXBannerView.js +2 -2
  23. package/lib/commonjs/CloudXMRECView.js +2 -2
  24. package/lib/commonjs/hooks.js +81 -0
  25. package/lib/commonjs/hooks.js.map +1 -1
  26. package/lib/commonjs/index.js +37 -0
  27. package/lib/commonjs/index.js.map +1 -1
  28. package/lib/commonjs/specs/CloudXAdViewNativeComponent.js +1 -1
  29. package/lib/commonjs/specs/NativeCloudX.js.map +1 -1
  30. package/lib/commonjs/types/AppOpenAd.js +6 -0
  31. package/lib/commonjs/types/AppOpenAd.js.map +1 -0
  32. package/lib/commonjs/types/Arbiter.js +6 -0
  33. package/lib/commonjs/types/Arbiter.js.map +1 -1
  34. package/lib/commonjs/types/RevenueData.js +21 -0
  35. package/lib/commonjs/types/RevenueData.js.map +1 -0
  36. package/lib/commonjs/types/index.js +17 -0
  37. package/lib/commonjs/types/index.js.map +1 -1
  38. package/lib/commonjs/version.js +1 -1
  39. package/lib/module/CloudX.js +5 -1
  40. package/lib/module/CloudX.js.map +1 -1
  41. package/lib/module/CloudXAdViewBase.js +11 -9
  42. package/lib/module/CloudXAdViewBase.js.map +1 -1
  43. package/lib/module/CloudXAppOpenAd.js +91 -0
  44. package/lib/module/CloudXAppOpenAd.js.map +1 -0
  45. package/lib/module/CloudXBannerView.js +2 -2
  46. package/lib/module/CloudXMRECView.js +2 -2
  47. package/lib/module/hooks.js +80 -0
  48. package/lib/module/hooks.js.map +1 -1
  49. package/lib/module/index.js +7 -1
  50. package/lib/module/index.js.map +1 -1
  51. package/lib/module/specs/CloudXAdViewNativeComponent.js +1 -1
  52. package/lib/module/specs/NativeCloudX.js.map +1 -1
  53. package/lib/module/types/AppOpenAd.js +2 -0
  54. package/lib/module/types/AppOpenAd.js.map +1 -0
  55. package/lib/module/types/Arbiter.js +6 -0
  56. package/lib/module/types/Arbiter.js.map +1 -1
  57. package/lib/module/types/RevenueData.js +15 -0
  58. package/lib/module/types/RevenueData.js.map +1 -0
  59. package/lib/module/types/index.js +1 -1
  60. package/lib/module/types/index.js.map +1 -1
  61. package/lib/module/version.js +1 -1
  62. package/lib/typescript/src/CloudX.d.ts.map +1 -1
  63. package/lib/typescript/src/CloudXAdViewBase.d.ts +1 -1
  64. package/lib/typescript/src/CloudXAdViewBase.d.ts.map +1 -1
  65. package/lib/typescript/src/CloudXAppOpenAd.d.ts +4 -0
  66. package/lib/typescript/src/CloudXAppOpenAd.d.ts.map +1 -0
  67. package/lib/typescript/src/CloudXBannerView.d.ts +2 -2
  68. package/lib/typescript/src/CloudXMRECView.d.ts +2 -2
  69. package/lib/typescript/src/hooks.d.ts +14 -0
  70. package/lib/typescript/src/hooks.d.ts.map +1 -1
  71. package/lib/typescript/src/index.d.ts +6 -3
  72. package/lib/typescript/src/index.d.ts.map +1 -1
  73. package/lib/typescript/src/specs/CloudXAdViewNativeComponent.d.ts +1 -1
  74. package/lib/typescript/src/specs/NativeCloudX.d.ts +13 -0
  75. package/lib/typescript/src/specs/NativeCloudX.d.ts.map +1 -1
  76. package/lib/typescript/src/types/AppOpenAd.d.ts +8 -0
  77. package/lib/typescript/src/types/AppOpenAd.d.ts.map +1 -0
  78. package/lib/typescript/src/types/Arbiter.d.ts +12 -2
  79. package/lib/typescript/src/types/Arbiter.d.ts.map +1 -1
  80. package/lib/typescript/src/types/CloudX.d.ts +6 -0
  81. package/lib/typescript/src/types/CloudX.d.ts.map +1 -1
  82. package/lib/typescript/src/types/RevenueData.d.ts +32 -0
  83. package/lib/typescript/src/types/RevenueData.d.ts.map +1 -0
  84. package/lib/typescript/src/types/index.d.ts +4 -1
  85. package/lib/typescript/src/types/index.d.ts.map +1 -1
  86. package/lib/typescript/src/version.d.ts +1 -1
  87. package/package.json +6 -2
  88. package/src/CloudX.ts +6 -0
  89. package/src/CloudXAdViewBase.tsx +12 -11
  90. package/src/CloudXAppOpenAd.ts +109 -0
  91. package/src/CloudXBannerView.tsx +2 -2
  92. package/src/CloudXMRECView.tsx +2 -2
  93. package/src/hooks.ts +103 -0
  94. package/src/index.ts +18 -2
  95. package/src/specs/CloudXAdViewNativeComponent.ts +1 -1
  96. package/src/specs/NativeCloudX.ts +22 -0
  97. package/src/types/AppOpenAd.ts +8 -0
  98. package/src/types/Arbiter.ts +20 -2
  99. package/src/types/CloudX.ts +7 -0
  100. package/src/types/RevenueData.ts +39 -0
  101. package/src/types/index.ts +4 -0
  102. package/src/version.ts +1 -1
@@ -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
  // =========================================================================
@@ -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,6 +1,6 @@
1
1
  import type { CloudXAdInfo } from './AdInfo';
2
2
 
3
- export type CloudXArbiterPlatform = 'CLOUDX' | 'LEVELPLAY' | 'PUBMATIC' | 'NONE';
3
+ export type CloudXArbiterPlatform = 'CLOUDX' | 'LEVELPLAY' | 'PUBMATIC' | 'CUSTOM' | 'NONE';
4
4
 
5
5
  export type CloudXSDKArbiterBid = {
6
6
  platform: 'CLOUDX';
@@ -22,10 +22,20 @@ export type CloudXPubMaticArbiterBid = {
22
22
  extras?: Record<string, string>;
23
23
  };
24
24
 
25
+ export type CloudXCustomArbiterBid = {
26
+ platform: 'CUSTOM';
27
+ platformName: string;
28
+ networkName: string;
29
+ revenuePerImpressionUSD: number;
30
+ precision: string;
31
+ extras?: Record<string, string>;
32
+ };
33
+
25
34
  export type CloudXArbiterBid =
26
35
  | CloudXSDKArbiterBid
27
36
  | CloudXLevelPlayArbiterBid
28
- | CloudXPubMaticArbiterBid;
37
+ | CloudXPubMaticArbiterBid
38
+ | CloudXCustomArbiterBid;
29
39
 
30
40
  export const CloudXArbiterBid = {
31
41
  cloudX(ad: CloudXAdInfo): CloudXSDKArbiterBid {
@@ -48,6 +58,13 @@ export const CloudXArbiterBid = {
48
58
  ...params,
49
59
  };
50
60
  },
61
+
62
+ custom(params: Omit<CloudXCustomArbiterBid, 'platform'>): CloudXCustomArbiterBid {
63
+ return {
64
+ platform: 'CUSTOM',
65
+ ...params,
66
+ };
67
+ },
51
68
  } as const;
52
69
 
53
70
  export type CloudXArbiterConfiguration = {
@@ -57,6 +74,7 @@ export type CloudXArbiterConfiguration = {
57
74
  export type CloudXArbiterResult = {
58
75
  id: string;
59
76
  platform: CloudXArbiterPlatform;
77
+ platformName: string;
60
78
  bidId?: string | null;
61
79
  extras: Record<string, string>;
62
80
  };
@@ -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
+ };
@@ -9,9 +9,13 @@ export type {
9
9
  CloudXSDKArbiterBid,
10
10
  CloudXLevelPlayArbiterBid,
11
11
  CloudXPubMaticArbiterBid,
12
+ CloudXCustomArbiterBid,
12
13
  } from './Arbiter';
14
+ export { CloudXRevenuePlatform, CloudXRevenuePrecision } from './RevenueData';
15
+ export type { CloudXRevenueData, CloudXRevenuePlatformValue, CloudXRevenuePrecisionValue } from './RevenueData';
13
16
  export type { CloudXFullscreenAdType } from './FullscreenAd';
14
17
  export type { CloudXInterstitialAdType } from './InterstitialAd';
18
+ export type { CloudXAppOpenAdType } from './AppOpenAd';
15
19
  export type { CloudXRewardedAdType } from './RewardedAd';
16
20
  export type { CloudXViewAdType } from './ViewAd';
17
21
  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.7';
6
+ export const PLUGIN_VERSION = '3.6.1';