Skip to main content
Requires iOS 13.0+, Xcode 16.0+, and Swift 6.0+.

Installation

CocoaPods

Podfile

Initialization

Ad Formats

CloudX supports banner, MREC, interstitial, rewarded, native, and app open ad integrations. Use the format-specific guides for implementation details:

Banner & MREC ads

Create fixed-size display placements with optional refresh control.

Interstitial ads

Load and show full-screen interstitial placements.

Native ads

Render native creatives in custom app layouts.

Rewarded ads

Reward users after completed rewarded ad views.

App Open ads

Full-screen placements for app launch and foreground moments.

Ad Information (CLXAd)

The CLXAd object is passed to delegate callbacks and contains information about the loaded/displayed ad:

Error Handling

All SDK errors are returned as CLXError objects in delegate callbacks:

Error Code Categories

Advanced Features

Debug Logging

Log Levels: verbose < debug < info < warn < error < none

Impression-Level Revenue Tracking

Set a revenueDelegate on any ad format to receive impression-level revenue (ILR) callbacks. The CLXAd object contains the revenue value in USD and the winning network name.
Works with all ad formats (banner, MREC, interstitial, rewarded, native).

Publisher-Reported Revenue Data

If your app receives impression-level revenue callbacks or bid metadata from AdMob, InMobi, TopOn, or another mediation platform outside the CloudX ad flow, forward those events to CloudX after initialization: reportRevenueData(_:) returns true when the event is accepted into the CloudX revenue pipeline. It returns false if the SDK is not initialized, server-side revenue tracking is disabled, or the platform name is blank. Acceptance is not a delivery guarantee.

AdMob paid events

AdMob iOS AdValue.value is already in the supplied currency units, so pass it directly to CloudX. Do not divide it by 1_000_000.0.

InMobi impression events

For InMobi, save the IMAdMetaInfo object from banner(_:didReceiveWithMetaInfo:). When bannerAdImpressed(_:) fires, send the saved metaInfo.getBid() to CloudX, then clear the saved value.
For interstitial and rewarded InMobi ads, use the same pattern with IMInterstitialDelegate: save IMAdMetaInfo in interstitial(_:didReceiveWithMetaInfo:), then report it in interstitialAdImpressed(_:).

TopOn revenue events

TopOn iOS reports revenue in didRevenueForPlacementID:extra:. Use publisher_revenue from extra as one-impression revenue and currency as the currency code.

Custom platform events

Use Custom for providers that do not have a CloudX SDK constant like AdMob, InMobi, and TopOn do. The value is only the provider name, such as CLXRevenuePlatformCustom(@"TradPlus") in Objective-C or CLXRevenuePlatform.custom("TradPlus") in Swift. Keep the name stable so CloudX can group that provider’s revenue consistently. Do not include the amount or currency in the provider name. For a TradPlus impression worth USD 0.01, send platform TradPlus, revenue 0.01, and currency code USD. If your source reports CPM/eCPM, divide by 1_000.0 first.

Delegate Threading

Publisher delegate callbacks are delivered on the main queue and may fire inline relative to the SDK call that triggered them. Keep delegate handlers re-entrant-safe if they call back into the SDK.

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:
  1. Initialize the SDK and check the logs for your device IFA:
  2. Copy the IFA and add it to your device whitelist on the CloudX server dashboard
  3. The SDK will automatically configure adapters for test mode and include the test flag in bid requests
Test mode is determined by the server, so you don’t need to change any code between development and production builds.

Privacy Compliance

The CloudX SDK supports GDPR and CCPA privacy compliance by reading standard IAB privacy strings from NSUserDefaults. These values are typically set automatically by your Consent Management Platform (CMP) such as Google UMP, OneTrust, or Sourcepoint.

How It Works

The SDK automatically detects user location and reads consent signals:
  1. 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)
  2. US Users (CCPA): Checks for sale/sharing opt-out signals
  3. Other Regions: No restrictions applied
When consent is denied or user opts out, the SDK removes PII from ad requests:
  • Advertising ID (IDFA) is cleared
  • Geo coordinates (lat/lon) are removed
  • User key-values are not sent
  • Hashed user ID is excluded

Supported Privacy Keys

The SDK prioritizes GPP (modern standard) over legacy TCF/US Privacy strings when both are available.

App Tracking Transparency (ATT)

On iOS 14.5+, you must request App Tracking Transparency authorization before the SDK can access the IDFA. Request ATT permission before initializing the CloudX SDK:
Add the NSUserTrackingUsageDescription key to your Info.plist with a description of why you need tracking permission.

Manual Privacy API

If you manage user consent yourself (without a CMP), you can set GDPR and CCPA privacy status directly. Call these before initializing the SDK — some ad network SDKs require privacy settings at initialization time and will not apply values set after init.
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. Pass nil to clear manual values and defer entirely to your CMP.

User Targeting

Support

For support, contact mobile@cloudx.io