Documentation Index
Fetch the complete documentation index at: https://docs.cloudx.io/llms.txt
Use this file to discover all available pages before exploring further.
Manual Installation
Requires React Native 0.70+, React 18.0+, iOS 13.0+, and Android API 23+.iOS Setup
Add ad network adapter pods to yourios/Podfile:
The
CloudXCore pod is automatically included as a dependency of the cloudx-react-native npm package. You only need to add the adapter pods you want.App Transport Security
If your ads use HTTP URLs, add the following to yourInfo.plist:
Android Setup
Add CloudX SDK and adapter dependencies to yourandroid/app/build.gradle:
At least one adapter is required for the SDK to serve ads.
android/build.gradle:
Initialization
Initialize the SDK before loading any ads:CloudX.initialize() returns a CloudXInitializationResult with:
success: boolean— whether initialization succeededmessage?: string— additional details, populated on failure
Ad Formats
CloudX React Native supports banner, MREC, interstitial, and rewarded ad integrations. Use the format-specific guides for implementation details:Banner & MREC ads
Create programmatic overlay display placements with optional refresh control.
Interstitial ads
Load and show full-screen interstitial placements.
Rewarded ads
Reward users after completed rewarded ad views.
Ad Information (CloudXAdInfo)
Most ad event callbacks receive aCloudXAdInfo object:
| Property | Type | Description |
|---|---|---|
adUnitId | string | The ad unit ID |
adFormat | string | Ad format: BANNER, MREC, INTERSTITIAL, or REWARDED |
networkName | string | Name of the winning ad network |
networkPlacement | string | null | Network-specific placement ID |
placement | string | null | Custom placement set by your integration |
revenue | number | Revenue value in USD |
adValues | Record<string, string> | SDK-provided ad metadata, used by features such as Trusted Arbiter |
Error Handling
All SDK errors are returned as error objects in callbacks and rejected promises:| Property | Type | Description |
|---|---|---|
code | CloudXErrorCode | Error category |
message | string | null | Human-readable description |
Error Code Categories
| Range | Category | Common Codes |
|---|---|---|
| 0 | General | internalError |
| 100-199 | Network | networkError, networkTimeout, networkNoConnection |
| 200-299 | Initialization | notInitialized, sdkDisabled, invalidAppKey |
| 300-399 | Ad Loading | noFill, invalidAdUnit, adsDisabled |
| 400-499 | Display | adNotReady, adAlreadyShowing |
| 600-699 | Adapter | adapterNoFill, adapterTimeout |
CloudXErrorCode export for the full list of error codes.
Advanced Features
Debug Logging
VERBOSE < DEBUG < INFO < WARN < ERROR < NONE
Native SDK logs appear in the iOS and Android platform logs. JavaScript-side calls and event handling can also be logged through your app’s normal React Native logging.
Impression-Level Revenue Tracking
Set anaddAdRevenuePaidListener callback on any ad format to receive impression-level revenue events. The CloudXAdInfo object includes the revenue value in USD and the winning network name.
Test Mode
Test mode is server-controlled via device whitelisting. This provides better security and control over which devices receive test ads. To enable test mode:- Initialize the SDK with verbose logging enabled.
- Find your device advertising ID in the iOS or Android platform logs.
- Add the advertising ID to your device whitelist on the CloudX server dashboard.
Privacy Compliance
The CloudX SDK supports GDPR and CCPA privacy compliance by reading standard IAB privacy strings from platform storage (NSUserDefaults on iOS, SharedPreferences on Android). These values are typically set automatically by your Consent Management Platform (CMP), such as Google UMP, OneTrust, or Sourcepoint.
How It Works
The native SDKs automatically detect user location and read consent signals:- EU Users (GDPR): Checks TCF v2 consent for purposes 1 and 2 per the IAB Global Vendor List and vendor consent (CloudX Vendor ID: 1510)
- US Users (CCPA): Checks for sale/sharing opt-out signals
- Other Regions: No restrictions applied
- Advertising ID (IDFA/GAID) is cleared
- Geo coordinates (lat/lon) are removed
- User key-values are not sent
- Hashed user ID is excluded
Supported Privacy Keys
| Key | Standard | Description |
|---|---|---|
IABGPP_HDR_GppString | GPP | Global Privacy Platform string (modern) |
IABGPP_GppSID | GPP | Section IDs (e.g., “2” for EU, “7” for US-National, “8” for US-CA) |
IABTCF_TCString | TCF v2 | GDPR consent string (legacy) |
IABTCF_gdprApplies | TCF v2 | Whether GDPR applies (1 = yes, 0 = no) |
IABUSPrivacy_String | US Privacy | CCPA privacy string (legacy, e.g., “1YNN”) |
Note: The SDK prioritizes GPP (modern standard) over legacy TCF/US Privacy strings when both are available.
Manual Privacy API
If you manage user consent yourself (without a CMP), you can set GDPR and CCPA privacy status directly. These can be called before or after SDK initialization.When both manual values and CMP signals are present, CMP signals (GPP/TCF/US Privacy) take priority. Manual values act as a fallback when no CMP is integrated.
User Targeting
App Tracking Transparency (iOS)
Request tracking authorization on iOS 14+:Call
requestTrackingAuthorization() before CloudX.initialize() for best ad targeting results.AUTHORIZED, DENIED, RESTRICTED, NOT_DETERMINED, NOT_REQUIRED.
On Android or iOS < 14, requestTrackingAuthorization() returns NOT_REQUIRED.