cloudx-react-native 3.2.0 → 3.4.4
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 +40 -652
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/cloudxreactnative/CloudXAdInfo.kt +9 -0
- package/android/src/main/java/com/cloudxreactnative/CloudXModuleImpl.kt +262 -0
- package/android/src/newarch/com/cloudxreactnative/CloudXModule.kt +6 -0
- package/android/src/oldarch/com/cloudxreactnative/CloudXModule.kt +7 -0
- package/cloudx-react-native.podspec +1 -1
- package/ios/CloudX.mm +313 -1
- package/lib/commonjs/CloudX.js +5 -1
- package/lib/commonjs/CloudX.js.map +1 -1
- package/lib/commonjs/CloudXBannerAd.js +4 -0
- package/lib/commonjs/CloudXBannerAd.js.map +1 -1
- package/lib/commonjs/CloudXInterstitialAd.js +4 -0
- package/lib/commonjs/CloudXInterstitialAd.js.map +1 -1
- package/lib/commonjs/CloudXMRECAd.js +4 -0
- package/lib/commonjs/CloudXMRECAd.js.map +1 -1
- package/lib/commonjs/CloudXRewardedAd.js +4 -0
- package/lib/commonjs/CloudXRewardedAd.js.map +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/specs/NativeCloudX.js +1 -1
- package/lib/commonjs/specs/NativeCloudX.js.map +1 -1
- package/lib/commonjs/types/Arbiter.js +27 -0
- package/lib/commonjs/types/Arbiter.js.map +1 -0
- package/lib/commonjs/types/ExtraParameters.js +2 -0
- package/lib/commonjs/types/ExtraParameters.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/module/CloudX.js +5 -1
- package/lib/module/CloudX.js.map +1 -1
- package/lib/module/CloudXBannerAd.js +4 -0
- package/lib/module/CloudXBannerAd.js.map +1 -1
- package/lib/module/CloudXInterstitialAd.js +4 -0
- package/lib/module/CloudXInterstitialAd.js.map +1 -1
- package/lib/module/CloudXMRECAd.js +4 -0
- package/lib/module/CloudXMRECAd.js.map +1 -1
- package/lib/module/CloudXRewardedAd.js +4 -0
- package/lib/module/CloudXRewardedAd.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/specs/NativeCloudX.js +1 -1
- package/lib/module/specs/NativeCloudX.js.map +1 -1
- package/lib/module/types/Arbiter.js +21 -0
- package/lib/module/types/Arbiter.js.map +1 -0
- package/lib/module/types/ExtraParameters.js +2 -0
- package/lib/module/types/ExtraParameters.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/typescript/src/CloudX.d.ts.map +1 -1
- package/lib/typescript/src/CloudXBannerAd.d.ts.map +1 -1
- package/lib/typescript/src/CloudXInterstitialAd.d.ts.map +1 -1
- package/lib/typescript/src/CloudXMRECAd.d.ts.map +1 -1
- package/lib/typescript/src/CloudXRewardedAd.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeCloudX.d.ts +7 -1
- package/lib/typescript/src/specs/NativeCloudX.d.ts.map +1 -1
- package/lib/typescript/src/types/AdInfo.d.ts +2 -0
- package/lib/typescript/src/types/AdInfo.d.ts.map +1 -1
- package/lib/typescript/src/types/Arbiter.d.ts +35 -0
- package/lib/typescript/src/types/Arbiter.d.ts.map +1 -0
- package/lib/typescript/src/types/CloudX.d.ts +3 -0
- package/lib/typescript/src/types/CloudX.d.ts.map +1 -1
- package/lib/typescript/src/types/ExtraParameters.d.ts +7 -0
- package/lib/typescript/src/types/ExtraParameters.d.ts.map +1 -0
- package/lib/typescript/src/types/FullscreenAd.d.ts +3 -0
- package/lib/typescript/src/types/FullscreenAd.d.ts.map +1 -1
- package/lib/typescript/src/types/ViewAd.d.ts +2 -0
- package/lib/typescript/src/types/ViewAd.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +2 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +3 -1
- package/src/CloudX.ts +6 -0
- package/src/CloudXBannerAd.ts +6 -0
- package/src/CloudXInterstitialAd.ts +6 -0
- package/src/CloudXMRECAd.ts +6 -0
- package/src/CloudXRewardedAd.ts +6 -0
- package/src/index.ts +9 -0
- package/src/specs/NativeCloudX.ts +12 -1
- package/src/types/AdInfo.ts +3 -0
- package/src/types/Arbiter.ts +62 -0
- package/src/types/CloudX.ts +4 -0
- package/src/types/ExtraParameters.ts +11 -0
- package/src/types/FullscreenAd.ts +4 -0
- package/src/types/ViewAd.ts +2 -0
- package/src/types/index.ts +10 -0
- package/src/version.ts +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CloudXAdInfo, CloudXAdLoadFailedInfo } from './AdInfo';
|
|
2
2
|
import type { CloudXAdEventListener } from './AdEvent';
|
|
3
|
+
import type { CloudXExtraParameters } from './ExtraParameters';
|
|
3
4
|
import type { CloudXAdPosition } from '../CloudXAdPosition';
|
|
4
5
|
/**
|
|
5
6
|
* Shared interface for view-based ads (Banners and MRECs).
|
|
@@ -10,6 +11,7 @@ export type CloudXViewAdType = {
|
|
|
10
11
|
hideAd(adUnitId: string): void;
|
|
11
12
|
setPlacement(adUnitId: string, placement: string | null): void;
|
|
12
13
|
setCustomData(adUnitId: string, customData: string | null): void;
|
|
14
|
+
setExtraParameters(adUnitId: string, extraParameters: CloudXExtraParameters): void;
|
|
13
15
|
updatePosition(adUnitId: string, bannerPosition: CloudXAdPosition): void;
|
|
14
16
|
startAutoRefresh(adUnitId: string): void;
|
|
15
17
|
stopAutoRefresh(adUnitId: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewAd.d.ts","sourceRoot":"","sources":["../../../../src/types/ViewAd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC3B,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAC/D,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"ViewAd.d.ts","sourceRoot":"","sources":["../../../../src/types/ViewAd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC3B,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAC/D,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACjE,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAEnF,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAEzE,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAExC,wBAAwB,CAAC,QAAQ,EAAE,qBAAqB,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;IAC9E,2BAA2B,IAAI,IAAI,CAAC;IAEpC,4BAA4B,CAAC,QAAQ,EAAE,qBAAqB,CAAC,sBAAsB,CAAC,GAAG,IAAI,CAAC;IAC5F,+BAA+B,IAAI,IAAI,CAAC;IAExC,yBAAyB,CAAC,QAAQ,EAAE,qBAAqB,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;IAC/E,4BAA4B,IAAI,IAAI,CAAC;IAErC,0BAA0B,CAAC,QAAQ,EAAE,qBAAqB,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;IAChF,6BAA6B,IAAI,IAAI,CAAC;IAEtC,2BAA2B,CAAC,QAAQ,EAAE,qBAAqB,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;IACjF,8BAA8B,IAAI,IAAI,CAAC;IAEvC,wBAAwB,CAAC,QAAQ,EAAE,qBAAqB,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;IAC9E,2BAA2B,IAAI,IAAI,CAAC;CACvC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type { CloudXAdInfo, CloudXAdLoadFailedInfo, CloudXAdDisplayFailedInfo, CloudXAdRewardInfo } from './AdInfo';
|
|
2
2
|
export type { CloudXInitializationResult, CloudXConfiguration } from './Configuration';
|
|
3
3
|
export type { CloudXType, CloudXLogLevelValue } from './CloudX';
|
|
4
|
+
export type { CloudXArbiterBid, CloudXArbiterConfiguration, CloudXArbiterPlatform, CloudXArbiterResult, CloudXSDKArbiterBid, CloudXLevelPlayArbiterBid, CloudXPubMaticArbiterBid, } from './Arbiter';
|
|
4
5
|
export type { CloudXFullscreenAdType } from './FullscreenAd';
|
|
5
6
|
export type { CloudXInterstitialAdType } from './InterstitialAd';
|
|
6
7
|
export type { CloudXRewardedAdType } from './RewardedAd';
|
|
@@ -9,4 +10,5 @@ export type { CloudXBannerAdType } from './BannerAd';
|
|
|
9
10
|
export type { CloudXMRECAdType } from './MRECAd';
|
|
10
11
|
export type { CloudXAdProps } from './AdProps';
|
|
11
12
|
export type { CloudXAdEventObject, CloudXAdEventListener } from './AdEvent';
|
|
13
|
+
export type { CloudXExtraParameterValue, CloudXExtraParameters } from './ExtraParameters';
|
|
12
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACpH,YAAY,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACvF,YAAY,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAChE,YAAY,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,YAAY,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACrD,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACpH,YAAY,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACvF,YAAY,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAChE,YAAY,EACR,gBAAgB,EAChB,0BAA0B,EAC1B,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,GAC3B,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,YAAY,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACrD,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAC5E,YAAY,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PLUGIN_VERSION = "3.
|
|
1
|
+
export declare const PLUGIN_VERSION = "3.4.4";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudx-react-native",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.4",
|
|
4
4
|
"description": "React Native wrapper for CloudX SDK (iOS & Android)",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -45,6 +45,8 @@
|
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/react": "^18.0.0",
|
|
48
|
+
"react": "18.3.1",
|
|
49
|
+
"react-native": "0.76.2",
|
|
48
50
|
"react-native-builder-bob": "^0.20.4",
|
|
49
51
|
"typescript": "^5.2.2"
|
|
50
52
|
},
|
package/src/CloudX.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CloudXType, CloudXLogLevelValue } from './types/CloudX';
|
|
2
2
|
import type { CloudXInitializationResult } from './types/Configuration';
|
|
3
|
+
import type { CloudXArbiterConfiguration, CloudXArbiterResult } from './types/Arbiter';
|
|
3
4
|
import NativeCloudX from './specs/NativeCloudX';
|
|
4
5
|
import { PLUGIN_VERSION } from './version';
|
|
5
6
|
|
|
@@ -51,6 +52,10 @@ const setDoNotSell = (isDoNotSell: boolean | null): void => {
|
|
|
51
52
|
NativeCloudX.setDoNotSell(isDoNotSell);
|
|
52
53
|
};
|
|
53
54
|
|
|
55
|
+
const arbiter = (configuration: CloudXArbiterConfiguration): Promise<CloudXArbiterResult> => {
|
|
56
|
+
return NativeCloudX.arbiter(configuration) as Promise<CloudXArbiterResult>;
|
|
57
|
+
};
|
|
58
|
+
|
|
54
59
|
export const CloudX: CloudXType = {
|
|
55
60
|
isInitialized,
|
|
56
61
|
initialize,
|
|
@@ -64,6 +69,7 @@ export const CloudX: CloudXType = {
|
|
|
64
69
|
setVisualDebuggingEnabled,
|
|
65
70
|
setHasUserConsent,
|
|
66
71
|
setDoNotSell,
|
|
72
|
+
arbiter,
|
|
67
73
|
};
|
|
68
74
|
|
|
69
75
|
export default CloudX;
|
package/src/CloudXBannerAd.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { addEventListener, removeEventListener } from './EventEmitter';
|
|
|
2
2
|
import type { CloudXAdPosition } from './CloudXAdPosition';
|
|
3
3
|
import type { CloudXAdInfo, CloudXAdLoadFailedInfo } from './types/AdInfo';
|
|
4
4
|
import type { CloudXBannerAdType } from './types/BannerAd';
|
|
5
|
+
import type { CloudXExtraParameters } from './types/ExtraParameters';
|
|
5
6
|
import NativeCloudX from './specs/NativeCloudX';
|
|
6
7
|
|
|
7
8
|
const {
|
|
@@ -41,6 +42,10 @@ const setCustomData = (adUnitId: string, customData: string | null): void => {
|
|
|
41
42
|
NativeCloudX.setBannerCustomData(adUnitId, customData);
|
|
42
43
|
};
|
|
43
44
|
|
|
45
|
+
const setExtraParameters = (adUnitId: string, extraParameters: CloudXExtraParameters): void => {
|
|
46
|
+
NativeCloudX.setBannerExtraParameters(adUnitId, extraParameters);
|
|
47
|
+
};
|
|
48
|
+
|
|
44
49
|
const updatePosition = (adUnitId: string, bannerPosition: CloudXAdPosition): void => {
|
|
45
50
|
NativeCloudX.updateBannerPosition(adUnitId, bannerPosition);
|
|
46
51
|
};
|
|
@@ -121,6 +126,7 @@ export const CloudXBannerAd: CloudXBannerAdType = {
|
|
|
121
126
|
|
|
122
127
|
setPlacement,
|
|
123
128
|
setCustomData,
|
|
129
|
+
setExtraParameters,
|
|
124
130
|
|
|
125
131
|
updatePosition,
|
|
126
132
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { addEventListener, removeEventListener } from './EventEmitter';
|
|
2
2
|
import type { CloudXAdDisplayFailedInfo, CloudXAdInfo, CloudXAdLoadFailedInfo } from './types/AdInfo';
|
|
3
|
+
import type { CloudXExtraParameters } from './types/ExtraParameters';
|
|
3
4
|
import type { CloudXFullscreenAdType } from './types/FullscreenAd';
|
|
4
5
|
import NativeCloudX from './specs/NativeCloudX';
|
|
5
6
|
|
|
@@ -21,6 +22,10 @@ const loadAd = (adUnitId: string): void => {
|
|
|
21
22
|
NativeCloudX.loadInterstitial(adUnitId);
|
|
22
23
|
};
|
|
23
24
|
|
|
25
|
+
const setExtraParameters = (adUnitId: string, extraParameters: CloudXExtraParameters): void => {
|
|
26
|
+
NativeCloudX.setInterstitialExtraParameters(adUnitId, extraParameters);
|
|
27
|
+
};
|
|
28
|
+
|
|
24
29
|
const showAd = (adUnitId: string, placement?: string | null, customData?: string | null): void => {
|
|
25
30
|
NativeCloudX.showInterstitial(adUnitId, placement ?? undefined, customData ?? undefined);
|
|
26
31
|
};
|
|
@@ -81,6 +86,7 @@ const removeAdRevenuePaidListener = (): void => {
|
|
|
81
86
|
export const CloudXInterstitialAd: CloudXFullscreenAdType = {
|
|
82
87
|
isAdReady,
|
|
83
88
|
loadAd,
|
|
89
|
+
setExtraParameters,
|
|
84
90
|
showAd,
|
|
85
91
|
destroyAd,
|
|
86
92
|
|
package/src/CloudXMRECAd.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { addEventListener, removeEventListener } from './EventEmitter';
|
|
|
2
2
|
import type { CloudXAdPosition } from './CloudXAdPosition';
|
|
3
3
|
import type { CloudXAdInfo, CloudXAdLoadFailedInfo } from './types/AdInfo';
|
|
4
4
|
import type { CloudXMRECAdType } from './types/MRECAd';
|
|
5
|
+
import type { CloudXExtraParameters } from './types/ExtraParameters';
|
|
5
6
|
import NativeCloudX from './specs/NativeCloudX';
|
|
6
7
|
|
|
7
8
|
const {
|
|
@@ -41,6 +42,10 @@ const setCustomData = (adUnitId: string, customData: string | null): void => {
|
|
|
41
42
|
NativeCloudX.setMRECCustomData(adUnitId, customData);
|
|
42
43
|
};
|
|
43
44
|
|
|
45
|
+
const setExtraParameters = (adUnitId: string, extraParameters: CloudXExtraParameters): void => {
|
|
46
|
+
NativeCloudX.setMRECExtraParameters(adUnitId, extraParameters);
|
|
47
|
+
};
|
|
48
|
+
|
|
44
49
|
const updatePosition = (adUnitId: string, bannerPosition: CloudXAdPosition): void => {
|
|
45
50
|
NativeCloudX.updateMRECPosition(adUnitId, bannerPosition);
|
|
46
51
|
};
|
|
@@ -121,6 +126,7 @@ export const CloudXMRECAd: CloudXMRECAdType = {
|
|
|
121
126
|
|
|
122
127
|
setPlacement,
|
|
123
128
|
setCustomData,
|
|
129
|
+
setExtraParameters,
|
|
124
130
|
|
|
125
131
|
updatePosition,
|
|
126
132
|
|
package/src/CloudXRewardedAd.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { addEventListener, removeEventListener } from './EventEmitter';
|
|
2
2
|
import type { CloudXAdDisplayFailedInfo, CloudXAdInfo, CloudXAdLoadFailedInfo, CloudXAdRewardInfo } from './types/AdInfo';
|
|
3
|
+
import type { CloudXExtraParameters } from './types/ExtraParameters';
|
|
3
4
|
import type { CloudXRewardedAdType } from './types/RewardedAd';
|
|
4
5
|
import NativeCloudX from './specs/NativeCloudX';
|
|
5
6
|
|
|
@@ -22,6 +23,10 @@ const loadAd = (adUnitId: string): void => {
|
|
|
22
23
|
NativeCloudX.loadRewarded(adUnitId);
|
|
23
24
|
};
|
|
24
25
|
|
|
26
|
+
const setExtraParameters = (adUnitId: string, extraParameters: CloudXExtraParameters): void => {
|
|
27
|
+
NativeCloudX.setRewardedExtraParameters(adUnitId, extraParameters);
|
|
28
|
+
};
|
|
29
|
+
|
|
25
30
|
const showAd = (adUnitId: string, placement?: string | null, customData?: string | null): void => {
|
|
26
31
|
NativeCloudX.showRewarded(adUnitId, placement ?? undefined, customData ?? undefined);
|
|
27
32
|
};
|
|
@@ -89,6 +94,7 @@ const removeAdRevenuePaidListener = (): void => {
|
|
|
89
94
|
export const CloudXRewardedAd: CloudXRewardedAdType = {
|
|
90
95
|
isAdReady,
|
|
91
96
|
loadAd,
|
|
97
|
+
setExtraParameters,
|
|
92
98
|
showAd,
|
|
93
99
|
destroyAd,
|
|
94
100
|
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Core SDK
|
|
2
2
|
export { default, CloudX } from './CloudX';
|
|
3
3
|
export { default as NativeCloudX } from './specs/NativeCloudX';
|
|
4
|
+
export { CloudXArbiterBid } from './types/Arbiter';
|
|
4
5
|
|
|
5
6
|
// Ad Modules
|
|
6
7
|
export { CloudXInterstitialAd } from './CloudXInterstitialAd';
|
|
@@ -29,6 +30,12 @@ export type {
|
|
|
29
30
|
CloudXConfiguration,
|
|
30
31
|
CloudXType,
|
|
31
32
|
CloudXLogLevelValue,
|
|
33
|
+
CloudXArbiterConfiguration,
|
|
34
|
+
CloudXArbiterPlatform,
|
|
35
|
+
CloudXArbiterResult,
|
|
36
|
+
CloudXSDKArbiterBid,
|
|
37
|
+
CloudXLevelPlayArbiterBid,
|
|
38
|
+
CloudXPubMaticArbiterBid,
|
|
32
39
|
CloudXFullscreenAdType,
|
|
33
40
|
CloudXInterstitialAdType,
|
|
34
41
|
CloudXRewardedAdType,
|
|
@@ -38,6 +45,8 @@ export type {
|
|
|
38
45
|
CloudXAdProps,
|
|
39
46
|
CloudXAdEventObject,
|
|
40
47
|
CloudXAdEventListener,
|
|
48
|
+
CloudXExtraParameterValue,
|
|
49
|
+
CloudXExtraParameters,
|
|
41
50
|
} from './types';
|
|
42
51
|
|
|
43
52
|
// Log level constants
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { TurboModule } from 'react-native';
|
|
2
|
+
import type { UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
|
|
2
3
|
import { TurboModuleRegistry } from 'react-native';
|
|
3
4
|
import type { CloudXConfiguration } from '../types/Configuration';
|
|
4
5
|
|
|
@@ -9,7 +10,7 @@ import type { CloudXConfiguration } from '../types/Configuration';
|
|
|
9
10
|
* Codegen uses this to produce type-safe native bindings.
|
|
10
11
|
*
|
|
11
12
|
* All methods correspond 1-to-1 with public APIs in the native iOS SDK
|
|
12
|
-
* (CloudXCore
|
|
13
|
+
* (CloudXCore) and the native Android SDK.
|
|
13
14
|
*/
|
|
14
15
|
export interface Spec extends TurboModule {
|
|
15
16
|
// =========================================================================
|
|
@@ -85,6 +86,12 @@ export interface Spec extends TurboModule {
|
|
|
85
86
|
setHasUserConsent(hasUserConsent: boolean | null): void;
|
|
86
87
|
setDoNotSell(isDoNotSell: boolean | null): void;
|
|
87
88
|
|
|
89
|
+
// =========================================================================
|
|
90
|
+
// Arbiter
|
|
91
|
+
// =========================================================================
|
|
92
|
+
|
|
93
|
+
arbiter(configuration: UnsafeObject): Promise<UnsafeObject>;
|
|
94
|
+
|
|
88
95
|
// =========================================================================
|
|
89
96
|
// Banner (Programmatic)
|
|
90
97
|
// =========================================================================
|
|
@@ -94,6 +101,7 @@ export interface Spec extends TurboModule {
|
|
|
94
101
|
setBannerBackgroundColor(adUnitId: string, hexColorString: string): void;
|
|
95
102
|
setBannerPlacement(adUnitId: string, placement: string | null): void;
|
|
96
103
|
setBannerCustomData(adUnitId: string, customData: string | null): void;
|
|
104
|
+
setBannerExtraParameters(adUnitId: string, extraParameters: UnsafeObject): void;
|
|
97
105
|
updateBannerPosition(adUnitId: string, position: string): void;
|
|
98
106
|
updateBannerOffsets(adUnitId: string, xOffset: number, yOffset: number): void;
|
|
99
107
|
startBannerAutoRefresh(adUnitId: string): void;
|
|
@@ -110,6 +118,7 @@ export interface Spec extends TurboModule {
|
|
|
110
118
|
createMRECWithOffsets(adUnitId: string, position: string, xOffset: number, yOffset: number): void;
|
|
111
119
|
setMRECPlacement(adUnitId: string, placement: string | null): void;
|
|
112
120
|
setMRECCustomData(adUnitId: string, customData: string | null): void;
|
|
121
|
+
setMRECExtraParameters(adUnitId: string, extraParameters: UnsafeObject): void;
|
|
113
122
|
updateMRECPosition(adUnitId: string, position: string): void;
|
|
114
123
|
updateMRECOffsets(adUnitId: string, xOffset: number, yOffset: number): void;
|
|
115
124
|
startMRECAutoRefresh(adUnitId: string): void;
|
|
@@ -124,6 +133,7 @@ export interface Spec extends TurboModule {
|
|
|
124
133
|
// =========================================================================
|
|
125
134
|
|
|
126
135
|
loadInterstitial(adUnitId: string): void;
|
|
136
|
+
setInterstitialExtraParameters(adUnitId: string, extraParameters: UnsafeObject): void;
|
|
127
137
|
isInterstitialReady(adUnitId: string): Promise<boolean>;
|
|
128
138
|
showInterstitial(adUnitId: string, placement?: string | null, customData?: string | null): void;
|
|
129
139
|
destroyInterstitial(adUnitId: string): void;
|
|
@@ -133,6 +143,7 @@ export interface Spec extends TurboModule {
|
|
|
133
143
|
// =========================================================================
|
|
134
144
|
|
|
135
145
|
loadRewarded(adUnitId: string): void;
|
|
146
|
+
setRewardedExtraParameters(adUnitId: string, extraParameters: UnsafeObject): void;
|
|
136
147
|
isRewardedReady(adUnitId: string): Promise<boolean>;
|
|
137
148
|
showRewarded(adUnitId: string, placement?: string | null, customData?: string | null): void;
|
|
138
149
|
destroyRewarded(adUnitId: string): void;
|
package/src/types/AdInfo.ts
CHANGED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { CloudXAdInfo } from './AdInfo';
|
|
2
|
+
|
|
3
|
+
export type CloudXArbiterPlatform = 'CLOUDX' | 'LEVELPLAY' | 'PUBMATIC' | 'NONE';
|
|
4
|
+
|
|
5
|
+
export type CloudXSDKArbiterBid = {
|
|
6
|
+
platform: 'CLOUDX';
|
|
7
|
+
ad: CloudXAdInfo;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type CloudXLevelPlayArbiterBid = {
|
|
11
|
+
platform: 'LEVELPLAY';
|
|
12
|
+
networkName: string;
|
|
13
|
+
revenue: number;
|
|
14
|
+
precision: string;
|
|
15
|
+
extras?: Record<string, string>;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type CloudXPubMaticArbiterBid = {
|
|
19
|
+
platform: 'PUBMATIC';
|
|
20
|
+
price: number;
|
|
21
|
+
partnerName?: string | null;
|
|
22
|
+
extras?: Record<string, string>;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type CloudXArbiterBid =
|
|
26
|
+
| CloudXSDKArbiterBid
|
|
27
|
+
| CloudXLevelPlayArbiterBid
|
|
28
|
+
| CloudXPubMaticArbiterBid;
|
|
29
|
+
|
|
30
|
+
export const CloudXArbiterBid = {
|
|
31
|
+
cloudX(ad: CloudXAdInfo): CloudXSDKArbiterBid {
|
|
32
|
+
return {
|
|
33
|
+
platform: 'CLOUDX',
|
|
34
|
+
ad,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
levelPlay(params: Omit<CloudXLevelPlayArbiterBid, 'platform'>): CloudXLevelPlayArbiterBid {
|
|
39
|
+
return {
|
|
40
|
+
platform: 'LEVELPLAY',
|
|
41
|
+
...params,
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
pubMatic(params: Omit<CloudXPubMaticArbiterBid, 'platform'>): CloudXPubMaticArbiterBid {
|
|
46
|
+
return {
|
|
47
|
+
platform: 'PUBMATIC',
|
|
48
|
+
...params,
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
} as const;
|
|
52
|
+
|
|
53
|
+
export type CloudXArbiterConfiguration = {
|
|
54
|
+
bids: CloudXArbiterBid[];
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export type CloudXArbiterResult = {
|
|
58
|
+
id: string;
|
|
59
|
+
platform: CloudXArbiterPlatform;
|
|
60
|
+
bidId?: string | null;
|
|
61
|
+
extras: Record<string, string>;
|
|
62
|
+
};
|
package/src/types/CloudX.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CloudXInitializationResult } from './Configuration';
|
|
2
|
+
import type { CloudXArbiterConfiguration, CloudXArbiterResult } from './Arbiter';
|
|
2
3
|
|
|
3
4
|
export type CloudXLogLevelValue = 'verbose' | 'debug' | 'info' | 'warn' | 'error' | 'none';
|
|
4
5
|
|
|
@@ -53,4 +54,7 @@ export type CloudXType = {
|
|
|
53
54
|
* priority when present.
|
|
54
55
|
*/
|
|
55
56
|
setDoNotSell(isDoNotSell: boolean | null): void;
|
|
57
|
+
|
|
58
|
+
/** Runs CloudX Arbiter using bid data passed through to the native SDK. */
|
|
59
|
+
arbiter(configuration: CloudXArbiterConfiguration): Promise<CloudXArbiterResult>;
|
|
56
60
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CloudXAdDisplayFailedInfo, CloudXAdInfo, CloudXAdLoadFailedInfo } from './AdInfo';
|
|
2
2
|
import type { CloudXAdEventListener } from './AdEvent';
|
|
3
|
+
import type { CloudXExtraParameters } from './ExtraParameters';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Shared interface for fullscreen ad types (Interstitial, Rewarded).
|
|
@@ -11,6 +12,9 @@ export type CloudXFullscreenAdType = {
|
|
|
11
12
|
/** Loads an ad for the given ad unit. */
|
|
12
13
|
loadAd(adUnitId: string): void;
|
|
13
14
|
|
|
15
|
+
/** Sets or clears extra parameters attached to the next bid request for this ad. */
|
|
16
|
+
setExtraParameters(adUnitId: string, extraParameters: CloudXExtraParameters): void;
|
|
17
|
+
|
|
14
18
|
/** Shows a previously loaded ad. */
|
|
15
19
|
showAd(adUnitId: string, placement?: string | null, customData?: string | null): void;
|
|
16
20
|
|
package/src/types/ViewAd.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CloudXAdInfo, CloudXAdLoadFailedInfo } from './AdInfo';
|
|
2
2
|
import type { CloudXAdEventListener } from './AdEvent';
|
|
3
|
+
import type { CloudXExtraParameters } from './ExtraParameters';
|
|
3
4
|
import type { CloudXAdPosition } from '../CloudXAdPosition';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -12,6 +13,7 @@ export type CloudXViewAdType = {
|
|
|
12
13
|
|
|
13
14
|
setPlacement(adUnitId: string, placement: string | null): void;
|
|
14
15
|
setCustomData(adUnitId: string, customData: string | null): void;
|
|
16
|
+
setExtraParameters(adUnitId: string, extraParameters: CloudXExtraParameters): void;
|
|
15
17
|
|
|
16
18
|
updatePosition(adUnitId: string, bannerPosition: CloudXAdPosition): void;
|
|
17
19
|
|
package/src/types/index.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
export type { CloudXAdInfo, CloudXAdLoadFailedInfo, CloudXAdDisplayFailedInfo, CloudXAdRewardInfo } from './AdInfo';
|
|
2
2
|
export type { CloudXInitializationResult, CloudXConfiguration } from './Configuration';
|
|
3
3
|
export type { CloudXType, CloudXLogLevelValue } from './CloudX';
|
|
4
|
+
export type {
|
|
5
|
+
CloudXArbiterBid,
|
|
6
|
+
CloudXArbiterConfiguration,
|
|
7
|
+
CloudXArbiterPlatform,
|
|
8
|
+
CloudXArbiterResult,
|
|
9
|
+
CloudXSDKArbiterBid,
|
|
10
|
+
CloudXLevelPlayArbiterBid,
|
|
11
|
+
CloudXPubMaticArbiterBid,
|
|
12
|
+
} from './Arbiter';
|
|
4
13
|
export type { CloudXFullscreenAdType } from './FullscreenAd';
|
|
5
14
|
export type { CloudXInterstitialAdType } from './InterstitialAd';
|
|
6
15
|
export type { CloudXRewardedAdType } from './RewardedAd';
|
|
@@ -9,3 +18,4 @@ export type { CloudXBannerAdType } from './BannerAd';
|
|
|
9
18
|
export type { CloudXMRECAdType } from './MRECAd';
|
|
10
19
|
export type { CloudXAdProps } from './AdProps';
|
|
11
20
|
export type { CloudXAdEventObject, CloudXAdEventListener } from './AdEvent';
|
|
21
|
+
export type { CloudXExtraParameterValue, CloudXExtraParameters } from './ExtraParameters';
|
package/src/version.ts
CHANGED