API Reference
Initialization
| Method | Return Type | Description |
|---|---|---|
InitializeAsync(string appKey, bool testMode) | Task<CloudXError?> | Initializes the SDK. Returns null on success, CloudXError on failure. |
Configuration
Call these methods beforeInitializeAsync:
| Method | Description |
|---|---|
SetHashedUserId(string hashedUserId) | Sets a hashed user identifier for targeting. |
SetUserKeyValue(string key, string value) | Sets a custom user-level key-value pair. |
SetAppKeyValue(string key, string value) | Sets a custom app-level key-value pair. |
ClearAllKeyValues() | Clears all custom key-value pairs. |
Banner Methods
| Method | Description |
|---|---|
CreateBanner(string placementName, CloudXAdViewConfiguration config) | Creates a banner ad view. |
ShowBanner(string placementName) | Shows a banner ad. |
HideBanner(string placementName) | Hides a banner ad. |
LoadBanner(string placementName) | Manually loads a banner ad (only when auto-refresh is disabled). |
StartBannerAutoRefresh(string placementName) | Starts automatic banner refresh. |
StopBannerAutoRefresh(string placementName) | Stops automatic banner refresh. |
DestroyBanner(string placementName) | Destroys a banner ad view. |
MREC Methods
| Method | Description |
|---|---|
CreateMrec(string placementName, CloudXAdViewConfiguration config) | Creates an MREC ad view. |
ShowMrec(string placementName) | Shows an MREC ad. |
HideMrec(string placementName) | Hides an MREC ad. |
LoadMrec(string placementName) | Manually loads an MREC ad (only when auto-refresh is disabled). |
StartMrecAutoRefresh(string placementName) | Starts automatic MREC refresh. |
StopMrecAutoRefresh(string placementName) | Stops automatic MREC refresh. |
DestroyMrec(string placementName) | Destroys an MREC ad view. |
Interstitial Methods
| Method | Return Type | Description |
|---|---|---|
LoadInterstitial(string placementName) | void | Loads an interstitial ad. |
ShowInterstitial(string placementName) | void | Shows an interstitial ad. |
IsInterstitialReady(string placementName) | bool | Checks if interstitial is ready to show. |
Rewarded Methods
| Method | Return Type | Description |
|---|---|---|
LoadRewarded(string placementName) | void | Loads a rewarded ad. |
ShowRewarded(string placementName) | void | Shows a rewarded ad. |
IsRewardedReady(string placementName) | bool | Checks if rewarded ad is ready to show. |
CloudXAd Properties
| Property | Type | Description |
|---|---|---|
PlacementName | string | The placement name used when creating/loading the ad. |
PlacementId | string | The unique placement identifier. |
BidderName | string | The name of the winning bidder network. |
ExternalPlacementId | string? | External placement ID (nullable). |
Revenue | double | Revenue generated by this ad impression in USD. |
CloudXError Properties
| Property | Type | Description |
|---|---|---|
errorCodeName | string | Error code name (e.g., “NO_FILL”, “NETWORK_ERROR”). |
errorCodeValue | int | Numeric error code. |
message | string? | Optional error message. |
AdViewPosition Enum
Position options for banner and MREC ads (3x3 grid):| Value | Description |
|---|---|
TopLeft | Top-left corner of the screen. |
TopCenter | Top center of the screen. |
TopRight | Top-right corner of the screen. |
CenterLeft | Center-left of the screen. |
Centered | Center of the screen. |
CenterRight | Center-right of the screen. |
BottomLeft | Bottom-left corner of the screen. |
BottomCenter | Bottom center of the screen. |
BottomRight | Bottom-right corner of the screen. |
Event Callbacks Reference
Banner Callbacks
| Event | Type | Description |
|---|---|---|
CloudXAdsCallbacks.Banner.OnAdLoadSuccess | Action<CloudXAd> | Banner ad loaded successfully. |
CloudXAdsCallbacks.Banner.OnAdLoadFailed | Action<CloudXError> | Banner ad failed to load. |
CloudXAdsCallbacks.Banner.OnAdClicked | Action<CloudXAd> | Banner ad was clicked. |
CloudXAdsCallbacks.Banner.OnAdRevenuePaid | Action<CloudXAd> | Banner ad revenue was recorded. |
MREC Callbacks
| Event | Type | Description |
|---|---|---|
CloudXAdsCallbacks.Mrec.OnAdLoadSuccess | Action<CloudXAd> | MREC ad loaded successfully. |
CloudXAdsCallbacks.Mrec.OnAdLoadFailed | Action<CloudXError> | MREC ad failed to load. |
CloudXAdsCallbacks.Mrec.OnAdClicked | Action<CloudXAd> | MREC ad was clicked. |
CloudXAdsCallbacks.Mrec.OnAdRevenuePaid | Action<CloudXAd> | MREC ad revenue was recorded. |
Interstitial Callbacks
| Event | Type | Description |
|---|---|---|
CloudXAdsCallbacks.Interstitial.OnAdLoadSuccess | Action<CloudXAd> | Interstitial ad loaded successfully. |
CloudXAdsCallbacks.Interstitial.OnAdLoadFailed | Action<CloudXError> | Interstitial ad failed to load. |
CloudXAdsCallbacks.Interstitial.OnAdShowSuccess | Action<CloudXAd> | Interstitial ad displayed successfully. |
CloudXAdsCallbacks.Interstitial.OnAdShowFailed | Action<CloudXError> | Interstitial ad failed to display. |
CloudXAdsCallbacks.Interstitial.OnAdHidden | Action<CloudXAd> | Interstitial ad was dismissed. |
CloudXAdsCallbacks.Interstitial.OnAdClicked | Action<CloudXAd> | Interstitial ad was clicked. |
CloudXAdsCallbacks.Interstitial.OnAdRevenuePaid | Action<CloudXAd> | Interstitial ad revenue was recorded. |
Rewarded Callbacks
| Event | Type | Description |
|---|---|---|
CloudXAdsCallbacks.Rewarded.OnAdLoadSuccess | Action<CloudXAd> | Rewarded ad loaded successfully. |
CloudXAdsCallbacks.Rewarded.OnAdLoadFailed | Action<CloudXError> | Rewarded ad failed to load. |
CloudXAdsCallbacks.Rewarded.OnAdShowSuccess | Action<CloudXAd> | Rewarded ad displayed successfully. |
CloudXAdsCallbacks.Rewarded.OnAdShowFailed | Action<CloudXError> | Rewarded ad failed to display. |
CloudXAdsCallbacks.Rewarded.OnAdHidden | Action<CloudXAd> | Rewarded ad was dismissed. |
CloudXAdsCallbacks.Rewarded.OnAdClicked | Action<CloudXAd> | Rewarded ad was clicked. |
CloudXAdsCallbacks.Rewarded.OnAdRewarded | Action<CloudXAd> | User earned the reward. |
CloudXAdsCallbacks.Rewarded.OnAdRevenuePaid | Action<CloudXAd> | Rewarded ad revenue was recorded. |