Class NativeAdUnitLoader

com.yandex.mobile.ads.nativeads

public class NativeAdUnitLoader

This class is a loader for a native ad block.

Constructors

NativeAdUnitLoader(@NonNull final Context context, @NonNull final NativeAdLoaderConfiguration configuration)

Creates an object of the NativeAdUnitLoader class with the configuration.

Methods

void cancelLoading()

Cancels the loading of an ad with a native ad block.

void loadAdUnit(@NonNull final AdRequest adRequest)

Loads an ad with a native ad block in the background mode.

void setNativeAdUnitLoadListener(@Nullable final NativeAdUnitLoadListener listener)

Specifies an object of the NativeAdUnitLoadListener class for tracking the progress of native ad block loading.

Constructor Detail

NativeAdUnitLoader

public NativeAdUnitLoader (@NonNull final Context context, @NonNull final NativeAdLoaderConfiguration configuration)

Creates an object of the NativeAdUnitLoader class with the configuration.

Parameters:
context

An object of the Context system class.

configuration

Configuration for loading a native ad block.

Method Detail

cancelLoading

public void cancelLoading ()

Cancels the loading of an ad with a native ad block.

loadAdUnit

public void loadAdUnit (@NonNull final AdRequest adRequest)

Loads an ad with a native ad block in the background mode.

Parameters:
adRequest

An object of the AdRequest class with data for a targeted ad request.

setNativeAdUnitLoadListener

public void setNativeAdUnitLoadListener (@Nullable final NativeAdUnitLoadListener listener)

Specifies an object of the NativeAdUnitLoadListener class for tracking the progress of native ad block loading.

Parameters:
listener

An object of the NativeAdUnitLoadListener class.