- 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
ViewPager2withandroid:orientation="vertical". Each page is one Reel.
Reels API Surface
| Capability | CloudX API | Description |
|---|---|---|
| Detect video creative | ad.nativeAd?.isVideoContent | Returns true when the loaded creative is a video |
| Get video duration | ad.nativeAd?.videoDuration | Duration of the video in seconds (0.0 if unknown) |
| Ad dismissed by user | onNativeAdClosed(ad) listener callback | Fires when the user reports or hides the ad via AdChoices |
| Disable fullscreen | loader.isVideoFullScreenDisabled = true | Prevents the video from entering fullscreen on tap |
| Start unmuted | loader.isStartVideoUnmuted = true | Starts playback with sound on |
| Hide media controls | loader.isVideoMediaControlsHidden = true | Hides play/pause and progress bar controls |
Native-ad adapter support and dependencies are documented on the adapter overview pages. See the Meta Audience Network adapter for current native-ad support.
Create a Layout and View Binder
res/layout/native_ad_layout.xml
Create a Loader and Configure Video
| Property | Default | Reels Value | Description |
|---|---|---|---|
isVideoFullScreenDisabled | false | true | Prevents the video from entering fullscreen when tapped |
isStartVideoUnmuted | false | true | Starts video playback with sound on |
isVideoMediaControlsHidden | false | true | Hides play/pause and progress bar controls |
loadAd(). They are ignored for static image creatives. For a Reels-style feed, set all three to true.
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 (CloudXNativeAd)
TheCloudXNativeAd interface is available via ad.nativeAd in listener callbacks:
| Property | Type | Description |
|---|---|---|
title | String? | Headline text |
body | String? | Body / description text |
callToAction | String? | CTA button text (e.g., “Install Now”) |
advertiser | String? | Advertiser name |
icon | CloudXNativeAdImage? | App icon (as Drawable or Uri) |
mainImage | CloudXNativeAdImage? | Main image (static creatives) |
mediaView | View? | Video/media player view (adapter-provided) |
optionsView | View? | AdChoices or options view (adapter-provided) |
mediaContentAspectRatio | Float | Aspect ratio of the media content |
starRating | Double? | App store rating (0–5) |
isVideoContent | Boolean | Whether the creative is a video |
videoDuration | Double | Video length in seconds (0.0 if unknown) |
isExpired | Boolean | Whether the ad has expired |
Reels Feed Tips
- Use a
ViewPager2withandroid:orientation="vertical". Each item should beMATCH_PARENTin both dimensions. - Call
prepareForReuse()on theCloudXNativeAdViewwhen recycling items. - Create one
CloudXNativeAdLoaderper slot. Load ads sequentially. - Destroy ads when no longer needed via
destroy(ad).