public interface

AppLovinNativeAdService

com.applovin.nativeAds.AppLovinNativeAdService

Class Overview

Service which allows loading and pre-caching of native ads.

Summary

Public Methods
abstract boolean hasPreloadedAdForZoneId(String zoneId)
Check whether an ad for a given zone is pre-loaded and ready to be displayed.
abstract void loadNativeAds(int numAdsToLoad, String zoneId, AppLovinNativeAdLoadListener listener)
Load a batch of native ads, which are guaranteed not to repeat, asynchronously.
abstract void loadNativeAds(int numAdsToLoad, AppLovinNativeAdLoadListener listener)
Load a batch of native ads, which are guaranteed not to repeat, asynchronously.
abstract void precacheResources(AppLovinNativeAd ad, AppLovinNativeAdPrecacheListener listener)
Pre-cache image and video resources of a native ad.
abstract void preloadAdForZoneId(String zoneId)
Pre-load an ad for a given zone in the background, if one is not already available.

Public Methods

public abstract boolean hasPreloadedAdForZoneId (String zoneId)

Check whether an ad for a given zone is pre-loaded and ready to be displayed.

Parameters
zoneId Id of the zone for the ad to check for.
Returns
  • True if an ad for this zone is pre-loaded and ready to display without further network activity. NO if requesting an ad for this zone would require fetching over the network.

public abstract void loadNativeAds (int numAdsToLoad, String zoneId, AppLovinNativeAdLoadListener listener)

Load a batch of native ads, which are guaranteed not to repeat, asynchronously.

Parameters
numAdsToLoad The number of native ads to load.
zoneId The id of the zone to load the native ads for.
listener The listener to notify upon completion.

public abstract void loadNativeAds (int numAdsToLoad, AppLovinNativeAdLoadListener listener)

Load a batch of native ads, which are guaranteed not to repeat, asynchronously.

Parameters
numAdsToLoad The number of native ads to load.
listener The listener to notify upon completion.

public abstract void precacheResources (AppLovinNativeAd ad, AppLovinNativeAdPrecacheListener listener)

Pre-cache image and video resources of a native ad.

Parameters
ad The native ad whose resources should be cached.
listener The listener to notify upon completion.

public abstract void preloadAdForZoneId (String zoneId)

Pre-load an ad for a given zone in the background, if one is not already available.

Parameters
zoneId Id of the zone for the ad to cache.