Native ads let you render ad creatives using your own UI components — title, body, icon, media, call-to-action — in your own layout. With video creatives and the right playback settings, native ads become full-screen vertical “Reels” (the same UX as Instagram Reels or TikTok). A Reel is built from three things: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.
- A native ad with video content. The ad’s
mediaViewcontains the video player. Other assets (title, body, icon, CTA) are overlaid on top. - Video playback settings. Three properties on the loader disable fullscreen, start the video with sound, and hide media controls.
- A full-screen paging container. A
UICollectionViewwithpagingEnabled = YESand a vertical flow layout. Each cell is one Reel.
Reels API Surface
| Capability | CloudX API | Description |
|---|---|---|
| Detect video creative | ad.nativeAd.isVideoContent | Returns YES when the loaded creative is a video |
| Get video duration | ad.nativeAd.videoDuration | Duration of the video in seconds (0 if unknown) |
| Ad dismissed by user | didCloseNativeAd: delegate callback | Fires when the user reports or hides the ad via AdChoices |
| Disable fullscreen | loader.disableVideoFullScreen = YES | Prevents the video from entering fullscreen on tap |
| Start unmuted | loader.startVideoUnmuted = YES | Starts playback with sound on |
| Hide media controls | loader.hideVideoMediaControls = YES | Hides play/pause and mute/unmute controls |
Native-ad adapter support and dependencies are documented on the adapter pages.
Create a Loader and Configure Video
| Property | Default | Reels Value | Description |
|---|---|---|---|
disableVideoFullScreen | NO | YES | Prevents the video from entering fullscreen when tapped |
startVideoUnmuted | NO | YES | Starts video playback with sound on |
hideVideoMediaControls | NO | YES | Hides play/pause and mute/unmute controls |
loadAd. They are ignored for static image creatives. For a Reels-style feed, set all three to YES.
Build a Native Ad Layout
Create aCLXNativeAdView using a view binder that maps your custom subviews to asset roles:
CLXNativeAdView:
Load the Ad
Flow A — Load into a pre-built view:Handle Callbacks
Clean Up
Always destroy ads when you’re done with them:Native Ad Assets (CLXNativeAd)
TheCLXNativeAd object is available via ad.nativeAd in delegate callbacks:
| Property | Type | Description |
|---|---|---|
title | NSString? | Headline text |
body | NSString? | Body / description text |
callToAction | NSString? | CTA button text (e.g., “Install Now”) |
advertiser | NSString? | Advertiser name |
icon | CLXNativeAdImage? | App icon image |
mainImage | CLXNativeAdImage? | Main image (static creatives) |
mediaView | UIView? | Video/media player view (adapter-provided) |
optionsView | UIView? | AdChoices or options view (adapter-provided) |
mediaContentAspectRatio | CGFloat | Aspect ratio of the media content |
starRating | NSNumber? | App store rating (0–5) |
isVideoContent | BOOL | Whether the creative is a video |
videoDuration | NSTimeInterval | Video length in seconds (0 if unknown) |
expired | BOOL | Whether the ad has expired |
Reels Feed Tips
- Use a
UICollectionViewwithpagingEnabled = YESand a verticalUICollectionViewFlowLayoutwithminimumLineSpacing = 0. Each cell should be full-screen. - Call
prepareForReuseon theCLXNativeAdViewwhen recycling cells. - Create one
CLXNativeAdLoaderper slot. Load ads sequentially. - Destroy ads when no longer needed via
destroyAd:.