Package 

Interface CloudXNativeAdLoader

  • All Implemented Interfaces:
    io.cloudx.sdk.CloudXDestroyable

    
    public interface CloudXNativeAdLoader
     implements CloudXDestroyable
                        

    Loads and manages native ads.

    Create instances using CloudX.createNativeAdLoader.

    Native ads expose individual creative assets that publishers render in their own custom layout via CloudXNativeAdView and CloudXNativeAdViewBinder.

    Adapter support: Native ads currently require Meta Audience Network (FAN). Bids from other adapters are rejected with a descriptive error. Additional adapter support (InMobi, Mintegral, Vungle, Unity, etc.) is planned.

    • Method Detail

      • destroy

         abstract Unit destroy(CloudXAd ad)

        Destroys a specific loaded ad and releases its resources.

        Parameters:
        ad - The CloudXAd to destroy.
      • setPlacement

         abstract Unit setPlacement(String placement)

        Sets a placement identifier for tracking and reporting.

        Parameters:
        placement - Optional placement name (e.g., "home_screen", "feed").
      • setCustomData

         abstract Unit setCustomData(String customData)

        Sets custom data for tracking and reporting.

        Parameters:
        customData - Optional custom data string.
      • setExtraParameter

         abstract Unit setExtraParameter(String key, Object value)

        Sets or clears an extra parameter attached to future bid requests for this ad.

        Supported value types: String, Number, Boolean, Map, Iterable, Array, and Kotlin primitive arrays. Pass null to remove the key. Invalid values are ignored and logged — they never fail ad loading.

        Reserved floor keys:

        • "minFloor" — single-round publisher floor in USD CPM. Accepts a Number or decimal String.

        • "minFloors" — per-round floor overrides. Accepts a List / Array of numbers or decimal strings, or a JSON-array string.

        Values are captured at call time. If you pass a Map or List and later mutate it, earlier bid requests are unaffected — call setExtraParameter again to push updates.

        Mixed-validity containers: a Map keeps its valid entries and drops the invalid ones; a List / Array is all-or-nothing — any invalid element discards the entire collection, to preserve positional ordering for keys like "minFloors".

        Timing: native ads use the values current at the time of loadAd; changes after that take effect on the next loadAd call.

        Parameters:
        key - Parameter key.
        value - Value to store, or null to remove the key.
      • setLocalExtraParameter

         abstract Unit setLocalExtraParameter(String key, Object value)

        Sets or clears an adapter-level parameter for this native ad. The value is forwarded to the underlying native ad adapter (e.g., Meta, InMobi) and is not sent as an auction signal.

        Use setExtraParameter instead if you want the value sent in the bid request — including floor overrides ("minFloor" / "minFloors").

        Parameters:
        key - Parameter key.
        value - Value to store, or null to remove the key.
      • setIsVideoMediaControlsHidden

         abstract Unit setIsVideoMediaControlsHidden(Boolean isVideoMediaControlsHidden)

        When true, hides video playback controls (play/pause, progress bar, etc.). Set before calling loadAd. Default: false.