cloudx-react-native 3.4.7 → 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.
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/cloudxreactnative/CloudXAdEvents.kt +11 -5
- package/android/src/main/java/com/cloudxreactnative/CloudXAdInfo.kt +14 -0
- package/android/src/main/java/com/cloudxreactnative/CloudXAdView.kt +9 -15
- package/android/src/main/java/com/cloudxreactnative/CloudXAdViewEvent.kt +1 -1
- package/android/src/main/java/com/cloudxreactnative/CloudXModuleImpl.kt +166 -0
- package/android/src/newarch/com/cloudxreactnative/CloudXModule.kt +7 -0
- package/android/src/oldarch/com/cloudxreactnative/CloudXModule.kt +7 -0
- package/cloudx-react-native.podspec +3 -3
- package/ios/CloudX.h +2 -2
- package/ios/CloudX.mm +255 -5
- package/ios/CloudXAdView.h +10 -12
- package/ios/CloudXAdView.mm +10 -15
- package/ios/CloudXAdViewManager.h +6 -6
- package/ios/CloudXAdViewManager.mm +4 -4
- package/lib/commonjs/CloudX.js +5 -1
- package/lib/commonjs/CloudX.js.map +1 -1
- package/lib/commonjs/CloudXAdViewBase.js +11 -9
- package/lib/commonjs/CloudXAdViewBase.js.map +1 -1
- package/lib/commonjs/CloudXAppOpenAd.js +98 -0
- package/lib/commonjs/CloudXAppOpenAd.js.map +1 -0
- package/lib/commonjs/CloudXBannerView.js +2 -2
- package/lib/commonjs/CloudXMRECView.js +2 -2
- package/lib/commonjs/hooks.js +81 -0
- package/lib/commonjs/hooks.js.map +1 -1
- package/lib/commonjs/index.js +37 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/specs/CloudXAdViewNativeComponent.js +1 -1
- package/lib/commonjs/specs/NativeCloudX.js.map +1 -1
- package/lib/commonjs/types/AppOpenAd.js +6 -0
- package/lib/commonjs/types/AppOpenAd.js.map +1 -0
- package/lib/commonjs/types/RevenueData.js +21 -0
- package/lib/commonjs/types/RevenueData.js.map +1 -0
- package/lib/commonjs/types/index.js +17 -0
- package/lib/commonjs/types/index.js.map +1 -1
- 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/CloudXAdViewBase.js +11 -9
- package/lib/module/CloudXAdViewBase.js.map +1 -1
- package/lib/module/CloudXAppOpenAd.js +91 -0
- package/lib/module/CloudXAppOpenAd.js.map +1 -0
- package/lib/module/CloudXBannerView.js +2 -2
- package/lib/module/CloudXMRECView.js +2 -2
- package/lib/module/hooks.js +80 -0
- package/lib/module/hooks.js.map +1 -1
- package/lib/module/index.js +7 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/specs/CloudXAdViewNativeComponent.js +1 -1
- package/lib/module/specs/NativeCloudX.js.map +1 -1
- package/lib/module/types/AppOpenAd.js +2 -0
- package/lib/module/types/AppOpenAd.js.map +1 -0
- package/lib/module/types/RevenueData.js +15 -0
- package/lib/module/types/RevenueData.js.map +1 -0
- package/lib/module/types/index.js +1 -1
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/src/CloudX.d.ts.map +1 -1
- package/lib/typescript/src/CloudXAdViewBase.d.ts +1 -1
- package/lib/typescript/src/CloudXAdViewBase.d.ts.map +1 -1
- package/lib/typescript/src/CloudXAppOpenAd.d.ts +4 -0
- package/lib/typescript/src/CloudXAppOpenAd.d.ts.map +1 -0
- package/lib/typescript/src/CloudXBannerView.d.ts +2 -2
- package/lib/typescript/src/CloudXMRECView.d.ts +2 -2
- package/lib/typescript/src/hooks.d.ts +14 -0
- package/lib/typescript/src/hooks.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +6 -3
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/CloudXAdViewNativeComponent.d.ts +1 -1
- package/lib/typescript/src/specs/NativeCloudX.d.ts +13 -0
- package/lib/typescript/src/specs/NativeCloudX.d.ts.map +1 -1
- package/lib/typescript/src/types/AppOpenAd.d.ts +8 -0
- package/lib/typescript/src/types/AppOpenAd.d.ts.map +1 -0
- package/lib/typescript/src/types/CloudX.d.ts +6 -0
- package/lib/typescript/src/types/CloudX.d.ts.map +1 -1
- package/lib/typescript/src/types/RevenueData.d.ts +32 -0
- package/lib/typescript/src/types/RevenueData.d.ts.map +1 -0
- package/lib/typescript/src/types/index.d.ts +3 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +6 -2
- package/src/CloudX.ts +6 -0
- package/src/CloudXAdViewBase.tsx +12 -11
- package/src/CloudXAppOpenAd.ts +109 -0
- package/src/CloudXBannerView.tsx +2 -2
- package/src/CloudXMRECView.tsx +2 -2
- package/src/hooks.ts +103 -0
- package/src/index.ts +17 -2
- package/src/specs/CloudXAdViewNativeComponent.ts +1 -1
- package/src/specs/NativeCloudX.ts +22 -0
- package/src/types/AppOpenAd.ts +8 -0
- package/src/types/CloudX.ts +7 -0
- package/src/types/RevenueData.ts +39 -0
- package/src/types/index.ts +3 -0
- package/src/version.ts +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CloudXFullscreenAdType } from './FullscreenAd';
|
|
2
|
+
/**
|
|
3
|
+
* App Open ad type — identical to the fullscreen ad interface.
|
|
4
|
+
* Provides a named type for consumers and a place to add app-open-specific
|
|
5
|
+
* methods in the future without refactoring.
|
|
6
|
+
*/
|
|
7
|
+
export type CloudXAppOpenAdType = CloudXFullscreenAdType;
|
|
8
|
+
//# sourceMappingURL=AppOpenAd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppOpenAd.d.ts","sourceRoot":"","sources":["../../../../src/types/AppOpenAd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAE7D;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,sBAAsB,CAAC"}
|
|
@@ -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
|
export type CloudXLogLevelValue = 'verbose' | 'debug' | 'info' | 'warn' | 'error' | 'none';
|
|
4
5
|
/**
|
|
5
6
|
* Main CloudX SDK module interface.
|
|
@@ -43,5 +44,10 @@ export type CloudXType = {
|
|
|
43
44
|
setDoNotSell(isDoNotSell: boolean | null): void;
|
|
44
45
|
/** Runs CloudX Arbiter using bid data passed through to the native SDK. */
|
|
45
46
|
arbiter(configuration: CloudXArbiterConfiguration): Promise<CloudXArbiterResult>;
|
|
47
|
+
/**
|
|
48
|
+
* Reports publisher-observed revenue data.
|
|
49
|
+
* Resolves false when unsupported, invalid, or rejected.
|
|
50
|
+
*/
|
|
51
|
+
reportRevenueData(data: CloudXRevenueData): Promise<boolean>;
|
|
46
52
|
};
|
|
47
53
|
//# sourceMappingURL=CloudX.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloudX.d.ts","sourceRoot":"","sources":["../../../../src/types/CloudX.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,KAAK,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"CloudX.d.ts","sourceRoot":"","sources":["../../../../src/types/CloudX.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,KAAK,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3F;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACrB,oDAAoD;IACpD,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAElC,yDAAyD;IACzD,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAEhE,qDAAqD;IACrD,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAE7B,6CAA6C;IAC7C,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAE9B,yDAAyD;IACzD,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAEjD,2CAA2C;IAC3C,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5C,sDAAsD;IACtD,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAElD,sDAAsD;IACtD,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjD,uCAAuC;IACvC,iBAAiB,IAAI,IAAI,CAAC;IAE1B,iFAAiF;IACjF,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAElD;;;;;;OAMG;IACH,iBAAiB,CAAC,cAAc,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC;IAExD;;;;;;OAMG;IACH,YAAY,CAAC,WAAW,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC;IAEhD,2EAA2E;IAC3E,OAAO,CAAC,aAAa,EAAE,0BAA0B,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEjF;;;OAGG;IACH,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAChE,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type CloudXRevenuePlatformValue = string;
|
|
2
|
+
export declare const CloudXRevenuePlatform: {
|
|
3
|
+
readonly ADMOB: "AdMob";
|
|
4
|
+
readonly custom: (name: string) => CloudXRevenuePlatformValue;
|
|
5
|
+
};
|
|
6
|
+
export declare const CloudXRevenuePrecision: {
|
|
7
|
+
readonly EXACT: "exact";
|
|
8
|
+
readonly ESTIMATED: "estimated";
|
|
9
|
+
readonly PUBLISHER_DEFINED: "publisher_defined";
|
|
10
|
+
readonly UNDEFINED: "undefined";
|
|
11
|
+
};
|
|
12
|
+
export type CloudXRevenuePrecisionValue = (typeof CloudXRevenuePrecision)[keyof typeof CloudXRevenuePrecision];
|
|
13
|
+
export type CloudXRevenueData = {
|
|
14
|
+
platform: CloudXRevenuePlatformValue;
|
|
15
|
+
/**
|
|
16
|
+
* Revenue for this impression in `currencyCode` units, not micros.
|
|
17
|
+
*
|
|
18
|
+
* Example: pass `1.234` for USD 1.234, not `1234000`.
|
|
19
|
+
*/
|
|
20
|
+
revenue: number;
|
|
21
|
+
adFormat: string;
|
|
22
|
+
currencyCode?: string | null;
|
|
23
|
+
precision?: CloudXRevenuePrecisionValue | null;
|
|
24
|
+
networkName?: string | null;
|
|
25
|
+
adUnitId?: string | null;
|
|
26
|
+
thirdPartyAdPlacementId?: string | null;
|
|
27
|
+
creativeId?: string | null;
|
|
28
|
+
networkPlacement?: string | null;
|
|
29
|
+
countryCode?: string | null;
|
|
30
|
+
userSegment?: string | null;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=RevenueData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RevenueData.d.ts","sourceRoot":"","sources":["../../../../src/types/RevenueData.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAEhD,eAAO,MAAM,qBAAqB;;4BAMf,MAAM,KAAG,0BAA0B;CAC5C,CAAC;AAEX,eAAO,MAAM,sBAAsB;;;;;CAKzB,CAAC;AAEX,MAAM,MAAM,2BAA2B,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,OAAO,sBAAsB,CAAC,CAAC;AAE/G,MAAM,MAAM,iBAAiB,GAAG;IAC5B,QAAQ,EAAE,0BAA0B,CAAC;IACrC;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,CAAC,EAAE,2BAA2B,GAAG,IAAI,CAAC;IAC/C,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,uBAAuB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,CAAC"}
|
|
@@ -2,8 +2,11 @@ export type { CloudXAdInfo, CloudXAdLoadFailedInfo, CloudXAdDisplayFailedInfo, C
|
|
|
2
2
|
export type { CloudXInitializationResult, CloudXConfiguration } from './Configuration';
|
|
3
3
|
export type { CloudXType, CloudXLogLevelValue } from './CloudX';
|
|
4
4
|
export type { CloudXArbiterBid, CloudXArbiterConfiguration, CloudXArbiterPlatform, CloudXArbiterResult, CloudXSDKArbiterBid, CloudXLevelPlayArbiterBid, CloudXPubMaticArbiterBid, } from './Arbiter';
|
|
5
|
+
export { CloudXRevenuePlatform, CloudXRevenuePrecision } from './RevenueData';
|
|
6
|
+
export type { CloudXRevenueData, CloudXRevenuePlatformValue, CloudXRevenuePrecisionValue } from './RevenueData';
|
|
5
7
|
export type { CloudXFullscreenAdType } from './FullscreenAd';
|
|
6
8
|
export type { CloudXInterstitialAdType } from './InterstitialAd';
|
|
9
|
+
export type { CloudXAppOpenAdType } from './AppOpenAd';
|
|
7
10
|
export type { CloudXRewardedAdType } from './RewardedAd';
|
|
8
11
|
export type { CloudXViewAdType } from './ViewAd';
|
|
9
12
|
export type { CloudXBannerAdType } from './BannerAd';
|
|
@@ -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,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
|
+
{"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,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC9E,YAAY,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAChH,YAAY,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,YAAY,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACjE,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,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.6.0";
|
|
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.6.0",
|
|
4
4
|
"description": "React Native wrapper for CloudX SDK (iOS & Android)",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -24,8 +24,9 @@
|
|
|
24
24
|
],
|
|
25
25
|
"scripts": {
|
|
26
26
|
"prepare": "bob build",
|
|
27
|
-
"typescript": "tsc --noEmit",
|
|
27
|
+
"typescript": "tsc --noEmit -p tsconfig.build.json",
|
|
28
28
|
"lint": "eslint \"src/**/*.{ts,tsx}\"",
|
|
29
|
+
"release:check": "node scripts/check-release-metadata.mjs && npm run typescript && npm run lint && npm pack --dry-run",
|
|
29
30
|
"clean": "rm -rf lib"
|
|
30
31
|
},
|
|
31
32
|
"keywords": [
|
|
@@ -44,7 +45,10 @@
|
|
|
44
45
|
"react-native": "*"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
48
|
+
"@react-native-community/eslint-config": "^3.2.0",
|
|
47
49
|
"@types/react": "^18.0.0",
|
|
50
|
+
"eslint": "^8.57.0",
|
|
51
|
+
"prettier": "2.8.8",
|
|
48
52
|
"react": "18.3.1",
|
|
49
53
|
"react-native": "0.76.2",
|
|
50
54
|
"react-native-builder-bob": "^0.20.4",
|
package/src/CloudX.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CloudXType, CloudXLogLevelValue } from './types/CloudX';
|
|
2
2
|
import type { CloudXInitializationResult } from './types/Configuration';
|
|
3
3
|
import type { CloudXArbiterConfiguration, CloudXArbiterResult } from './types/Arbiter';
|
|
4
|
+
import type { CloudXRevenueData } from './types/RevenueData';
|
|
4
5
|
import NativeCloudX from './specs/NativeCloudX';
|
|
5
6
|
import { PLUGIN_VERSION } from './version';
|
|
6
7
|
|
|
@@ -56,6 +57,10 @@ const arbiter = (configuration: CloudXArbiterConfiguration): Promise<CloudXArbit
|
|
|
56
57
|
return NativeCloudX.arbiter(configuration) as Promise<CloudXArbiterResult>;
|
|
57
58
|
};
|
|
58
59
|
|
|
60
|
+
const reportRevenueData = (data: CloudXRevenueData): Promise<boolean> => {
|
|
61
|
+
return NativeCloudX.reportRevenueData(data);
|
|
62
|
+
};
|
|
63
|
+
|
|
59
64
|
export const CloudX: CloudXType = {
|
|
60
65
|
isInitialized,
|
|
61
66
|
initialize,
|
|
@@ -70,6 +75,7 @@ export const CloudX: CloudXType = {
|
|
|
70
75
|
setHasUserConsent,
|
|
71
76
|
setDoNotSell,
|
|
72
77
|
arbiter,
|
|
78
|
+
reportRevenueData,
|
|
73
79
|
};
|
|
74
80
|
|
|
75
81
|
export default CloudX;
|
package/src/CloudXAdViewBase.tsx
CHANGED
|
@@ -54,9 +54,7 @@ const parseAdValues = (json?: string | null): Record<string, string> => {
|
|
|
54
54
|
}
|
|
55
55
|
try {
|
|
56
56
|
const parsed = JSON.parse(json);
|
|
57
|
-
return parsed && typeof parsed === 'object'
|
|
58
|
-
? parsed
|
|
59
|
-
: {};
|
|
57
|
+
return parsed && typeof parsed === 'object' ? parsed : {};
|
|
60
58
|
} catch {
|
|
61
59
|
return {};
|
|
62
60
|
}
|
|
@@ -147,7 +145,7 @@ const toNativeExtraParameterEntries = (
|
|
|
147
145
|
* events to the public CloudXAdProps callbacks, and hosts the native ad view.
|
|
148
146
|
*
|
|
149
147
|
* Note: overriding `style` with a non-IAB size resizes the host frame, not the
|
|
150
|
-
* creative
|
|
148
|
+
* creative — iOS pins the ad view to the host bounds and Android measures the
|
|
151
149
|
* creative from the host, so the served creative keeps its own standard
|
|
152
150
|
* dimensions inside the resized frame.
|
|
153
151
|
*/
|
|
@@ -165,12 +163,17 @@ export const CloudXAdViewBase: React.FC<CloudXAdViewBaseProps> = ({
|
|
|
165
163
|
...viewProps
|
|
166
164
|
}) => {
|
|
167
165
|
const [isTablet, setIsTablet] = useState(cachedIsTablet ?? false);
|
|
168
|
-
const nativeViewProps = viewProps
|
|
166
|
+
const nativeViewProps = { ...viewProps } as ViewProps & {
|
|
167
|
+
onAdExpanded?: unknown;
|
|
168
|
+
onAdCollapsed?: unknown;
|
|
169
|
+
};
|
|
170
|
+
delete nativeViewProps.onAdExpanded;
|
|
171
|
+
delete nativeViewProps.onAdCollapsed;
|
|
169
172
|
|
|
170
173
|
/*
|
|
171
174
|
* Gate native ad-view creation on SDK initialization. A view mounted before
|
|
172
175
|
* CloudX.initialize() completes would create the ad against an uninitialized
|
|
173
|
-
* SDK
|
|
176
|
+
* SDK — on iOS createBannerWithAdUnitId: returns nil and the view is
|
|
174
177
|
* permanently dead (no retry, no load-failed event). There is no init event
|
|
175
178
|
* to subscribe to, so poll isInitialized() until ready, then mount the
|
|
176
179
|
* native view (which is what delivers adUnitId/adFormat and triggers create).
|
|
@@ -258,11 +261,9 @@ export const CloudXAdViewBase: React.FC<CloudXAdViewBaseProps> = ({
|
|
|
258
261
|
[extraParameters]
|
|
259
262
|
);
|
|
260
263
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
* create). Swaps to the real ad view once isInitialized flips true.
|
|
265
|
-
*/
|
|
264
|
+
// Until the SDK is initialized, render a sized placeholder that reserves the
|
|
265
|
+
// ad slot's layout but does NOT mount the native view (so no pre-init
|
|
266
|
+
// create). Swaps to the real ad view once isInitialized flips true.
|
|
266
267
|
if (!isInitialized) {
|
|
267
268
|
return <View style={resolvedStyle} {...nativeViewProps} />;
|
|
268
269
|
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { addEventListener, removeEventListener } from './EventEmitter';
|
|
2
|
+
import type { CloudXAdDisplayFailedInfo, CloudXAdInfo, CloudXAdLoadFailedInfo } from './types/AdInfo';
|
|
3
|
+
import type { CloudXExtraParameters } from './types/ExtraParameters';
|
|
4
|
+
import type { CloudXFullscreenAdType } from './types/FullscreenAd';
|
|
5
|
+
import NativeCloudX from './specs/NativeCloudX';
|
|
6
|
+
|
|
7
|
+
const {
|
|
8
|
+
ON_APPOPEN_LOADED_EVENT,
|
|
9
|
+
ON_APPOPEN_LOAD_FAILED_EVENT,
|
|
10
|
+
ON_APPOPEN_CLICKED_EVENT,
|
|
11
|
+
ON_APPOPEN_DISPLAYED_EVENT,
|
|
12
|
+
ON_APPOPEN_DISPLAY_FAILED_EVENT,
|
|
13
|
+
ON_APPOPEN_HIDDEN_EVENT,
|
|
14
|
+
ON_APPOPEN_AD_REVENUE_PAID,
|
|
15
|
+
} = NativeCloudX.getConstants();
|
|
16
|
+
|
|
17
|
+
const isAdReady = (adUnitId: string): Promise<boolean> => {
|
|
18
|
+
return NativeCloudX.isAppOpenReady(adUnitId);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const loadAd = (adUnitId: string): void => {
|
|
22
|
+
NativeCloudX.loadAppOpen(adUnitId);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const setExtraParameters = (adUnitId: string, extraParameters: CloudXExtraParameters): void => {
|
|
26
|
+
NativeCloudX.setAppOpenExtraParameters(adUnitId, extraParameters);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const showAd = (adUnitId: string, placement?: string | null, customData?: string | null): void => {
|
|
30
|
+
NativeCloudX.showAppOpen(adUnitId, placement ?? undefined, customData ?? undefined);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const destroyAd = (adUnitId: string): void => {
|
|
34
|
+
NativeCloudX.destroyAppOpen(adUnitId);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const addAdLoadedEventListener = (listener: (adInfo: CloudXAdInfo) => void): void => {
|
|
38
|
+
addEventListener(ON_APPOPEN_LOADED_EVENT, listener);
|
|
39
|
+
};
|
|
40
|
+
const removeAdLoadedEventListener = (): void => {
|
|
41
|
+
removeEventListener(ON_APPOPEN_LOADED_EVENT);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const addAdLoadFailedEventListener = (listener: (errorInfo: CloudXAdLoadFailedInfo) => void): void => {
|
|
45
|
+
addEventListener(ON_APPOPEN_LOAD_FAILED_EVENT, listener);
|
|
46
|
+
};
|
|
47
|
+
const removeAdLoadFailedEventListener = (): void => {
|
|
48
|
+
removeEventListener(ON_APPOPEN_LOAD_FAILED_EVENT);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const addAdClickedEventListener = (listener: (adInfo: CloudXAdInfo) => void): void => {
|
|
52
|
+
addEventListener(ON_APPOPEN_CLICKED_EVENT, listener);
|
|
53
|
+
};
|
|
54
|
+
const removeAdClickedEventListener = (): void => {
|
|
55
|
+
removeEventListener(ON_APPOPEN_CLICKED_EVENT);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const addAdDisplayedEventListener = (listener: (adInfo: CloudXAdInfo) => void): void => {
|
|
59
|
+
addEventListener(ON_APPOPEN_DISPLAYED_EVENT, listener);
|
|
60
|
+
};
|
|
61
|
+
const removeAdDisplayedEventListener = (): void => {
|
|
62
|
+
removeEventListener(ON_APPOPEN_DISPLAYED_EVENT);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const addAdFailedToDisplayEventListener = (listener: (errorInfo: CloudXAdDisplayFailedInfo) => void): void => {
|
|
66
|
+
addEventListener(ON_APPOPEN_DISPLAY_FAILED_EVENT, listener);
|
|
67
|
+
};
|
|
68
|
+
const removeAdFailedToDisplayEventListener = (): void => {
|
|
69
|
+
removeEventListener(ON_APPOPEN_DISPLAY_FAILED_EVENT);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const addAdHiddenEventListener = (listener: (adInfo: CloudXAdInfo) => void): void => {
|
|
73
|
+
addEventListener(ON_APPOPEN_HIDDEN_EVENT, listener);
|
|
74
|
+
};
|
|
75
|
+
const removeAdHiddenEventListener = (): void => {
|
|
76
|
+
removeEventListener(ON_APPOPEN_HIDDEN_EVENT);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const addAdRevenuePaidListener = (listener: (adInfo: CloudXAdInfo) => void): void => {
|
|
80
|
+
addEventListener(ON_APPOPEN_AD_REVENUE_PAID, listener);
|
|
81
|
+
};
|
|
82
|
+
const removeAdRevenuePaidListener = (): void => {
|
|
83
|
+
removeEventListener(ON_APPOPEN_AD_REVENUE_PAID);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const CloudXAppOpenAd: CloudXFullscreenAdType = {
|
|
87
|
+
isAdReady,
|
|
88
|
+
loadAd,
|
|
89
|
+
setExtraParameters,
|
|
90
|
+
showAd,
|
|
91
|
+
destroyAd,
|
|
92
|
+
|
|
93
|
+
addAdLoadedEventListener,
|
|
94
|
+
removeAdLoadedEventListener,
|
|
95
|
+
addAdLoadFailedEventListener,
|
|
96
|
+
removeAdLoadFailedEventListener,
|
|
97
|
+
addAdClickedEventListener,
|
|
98
|
+
removeAdClickedEventListener,
|
|
99
|
+
addAdDisplayedEventListener,
|
|
100
|
+
removeAdDisplayedEventListener,
|
|
101
|
+
addAdFailedToDisplayEventListener,
|
|
102
|
+
removeAdFailedToDisplayEventListener,
|
|
103
|
+
addAdHiddenEventListener,
|
|
104
|
+
removeAdHiddenEventListener,
|
|
105
|
+
addAdRevenuePaidListener,
|
|
106
|
+
removeAdRevenuePaidListener,
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export default CloudXAppOpenAd;
|
package/src/CloudXBannerView.tsx
CHANGED
|
@@ -9,9 +9,9 @@ import type { CloudXAdViewProps } from './CloudXAdViewBase';
|
|
|
9
9
|
* RN view tree), this renders the banner as an ordinary React Native view, so
|
|
10
10
|
* app overlays such as toasts layer above it via normal RN z-ordering.
|
|
11
11
|
*
|
|
12
|
-
* Defaults to
|
|
12
|
+
* Defaults to 320×50 on phones and 728×90 on tablets; override via `style`.
|
|
13
13
|
* Overriding `style` to a non-standard size resizes the host frame, not the
|
|
14
|
-
* creative
|
|
14
|
+
* creative — the served banner keeps its own IAB dimensions inside that frame.
|
|
15
15
|
*/
|
|
16
16
|
export const CloudXBannerView: React.FC<CloudXAdViewProps> = (props) => (
|
|
17
17
|
<CloudXAdViewBase adFormat="BANNER" {...props} />
|
package/src/CloudXMRECView.tsx
CHANGED
|
@@ -9,9 +9,9 @@ import type { CloudXAdViewProps } from './CloudXAdViewBase';
|
|
|
9
9
|
* view tree), this renders the MREC as an ordinary React Native view, so app
|
|
10
10
|
* overlays such as toasts layer above it via normal RN z-ordering.
|
|
11
11
|
*
|
|
12
|
-
* Fixed size of
|
|
12
|
+
* Fixed size of 300×250; override via `style`.
|
|
13
13
|
* Overriding `style` to a non-standard size resizes the host frame, not the
|
|
14
|
-
* creative
|
|
14
|
+
* creative — the served MREC keeps its own dimensions inside that frame.
|
|
15
15
|
*/
|
|
16
16
|
export const CloudXMRECView: React.FC<CloudXAdViewProps> = (props) => (
|
|
17
17
|
<CloudXAdViewBase adFormat="MREC" {...props} />
|
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,10 +1,16 @@
|
|
|
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';
|
|
@@ -22,8 +28,13 @@ export { CloudXErrorCode } from './CloudXErrorCode';
|
|
|
22
28
|
export { requestTrackingAuthorization, getTrackingAuthorizationStatus, CloudXATTStatus } from './AppTrackingTransparency';
|
|
23
29
|
|
|
24
30
|
// Hooks
|
|
25
|
-
export { useCloudXInterstitial, useCloudXRewarded, useCloudXBanner } from './hooks';
|
|
26
|
-
export type {
|
|
31
|
+
export { useCloudXInterstitial, useCloudXAppOpen, useCloudXRewarded, useCloudXBanner } from './hooks';
|
|
32
|
+
export type {
|
|
33
|
+
CloudXInterstitialHookResult,
|
|
34
|
+
CloudXAppOpenHookResult,
|
|
35
|
+
CloudXRewardedHookResult,
|
|
36
|
+
CloudXBannerHookResult,
|
|
37
|
+
} from './hooks';
|
|
27
38
|
|
|
28
39
|
// Types
|
|
29
40
|
export type {
|
|
@@ -41,8 +52,12 @@ export type {
|
|
|
41
52
|
CloudXSDKArbiterBid,
|
|
42
53
|
CloudXLevelPlayArbiterBid,
|
|
43
54
|
CloudXPubMaticArbiterBid,
|
|
55
|
+
CloudXRevenueData,
|
|
56
|
+
CloudXRevenuePlatformValue,
|
|
57
|
+
CloudXRevenuePrecisionValue,
|
|
44
58
|
CloudXFullscreenAdType,
|
|
45
59
|
CloudXInterstitialAdType,
|
|
60
|
+
CloudXAppOpenAdType,
|
|
46
61
|
CloudXRewardedAdType,
|
|
47
62
|
CloudXViewAdType,
|
|
48
63
|
CloudXBannerAdType,
|
|
@@ -42,7 +42,7 @@ export type NativeExtraParameterEntry = Readonly<{
|
|
|
42
42
|
*
|
|
43
43
|
* This is the in-tree view component: the ad renders as an ordinary React
|
|
44
44
|
* Native view, so publisher overlays (toasts, modals) layer above it via
|
|
45
|
-
* normal RN z-ordering
|
|
45
|
+
* normal RN z-ordering — unlike the imperative overlay banner API.
|
|
46
46
|
*/
|
|
47
47
|
export interface NativeProps extends ViewProps {
|
|
48
48
|
/** Ad unit ID used to load the ad. */
|
|
@@ -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;
|
package/src/types/CloudX.ts
CHANGED
|
@@ -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
|
+
};
|
package/src/types/index.ts
CHANGED
|
@@ -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.
|
|
6
|
+
export const PLUGIN_VERSION = '3.6.0';
|