Android Verizon Ads SDK Standard Edition Documentation  1.14
Classes | Public Member Functions | Static Public Member Functions | List of all members
InterstitialAdFactory Class Reference

InterstitialAdFactory is a factory class that handles loading and caching of InterstitialAd placements. More...

Classes

interface  InterstitialAdFactoryListener
 Interface for receiving notifications from the InterstitialAdFactory. More...
 

Public Member Functions

 InterstitialAdFactory (final Context context, final String placementId, final InterstitialAdFactoryListener adFactoryListener)
 Factory method for creating InterstitialAd objects. More...
 
void abortLoad ()
 Aborts any load requests that are still active.
 
void destroy ()
 Frees the internal resources held by the factory. More...
 
String getPlacementId ()
 Get the placementId for the InterstitialAdFactory. More...
 
RequestMetadata getRequestMetadata ()
 Provides access to the RequestMetadata that has been set for the InterstitialAdFactory. More...
 
void load (final Bid bid, final InterstitialAdListener interstitialAdListener)
 Loads the InterstitialAd for the provided bid. More...
 
void load (final InterstitialAdListener interstitialAdListener)
 Requests a new InterstitialAd. More...
 
InterstitialAd loadAdFromCache (final InterstitialAdListener interstitialAdListener)
 Attempts to load a InterstitialAd from the cache. More...
 
void prefetch ()
 Initializes a cache replenishment request. More...
 
void setCacheReplenishmentThresholdOverride (final int cacheReplenishmentThresholdOverride)
 Sets the cache replenishment threshold. More...
 
void setListener (final InterstitialAdFactoryListener adFactoryListener)
 Set the InterstitialAdFactoryListener to receive ad factory event callbacks. More...
 
void setRequestMetaData (final RequestMetadata requestMetadata)
 Sets a RequestMetadata object that overrides global RequestMetadata for the InterstitialAdFactory’s ad requests. More...
 

Static Public Member Functions

static void requestBid (final Context context, final String placementId, final RequestMetadata requestMetadata, final BidRequestListener bidRequestListener)
 Requests a bid for the opportunity to win the InterstitialAd impression. More...
 

Detailed Description

InterstitialAdFactory is a factory class that handles loading and caching of InterstitialAd placements.

It uses the InterstitialAdFactoryListener interface to provide notifications about InterstitialAd creation.

Constructor & Destructor Documentation

◆ InterstitialAdFactory()

InterstitialAdFactory ( final Context  context,
final String  placementId,
final InterstitialAdFactoryListener  adFactoryListener 
)

Factory method for creating InterstitialAd objects.

Use this to set the placementId and listener for InterstitialAds that the InterstitialAdFactory will create.

Parameters
contextthe context in which the InterstitialAds will be displayed
placementIdplacementId that will be set for all InterstitialAds that the InterstitialAdFactory creates
adFactoryListenerthe InterstitialAdFactoryListener that will receive ad factory events for the InterstitialAdFactory

Member Function Documentation

◆ destroy()

void destroy ( )

Frees the internal resources held by the factory.

The instance cannot be used after this method is called.

◆ getPlacementId()

String getPlacementId ( )

Get the placementId for the InterstitialAdFactory.

Returns
the placementId for the InterstitialAdFactory

◆ getRequestMetadata()

RequestMetadata getRequestMetadata ( )

Provides access to the RequestMetadata that has been set for the InterstitialAdFactory.

Returns
the RequestMetadata set for the InterstitialAdFactory

◆ load() [1/2]

void load ( final Bid  bid,
final InterstitialAdListener  interstitialAdListener 
)

Loads the InterstitialAd for the provided bid.

Parameters
bidthe Bid that will be loaded
interstitialAdListenerthe InterstitialAd.InterstitialAdListener that will receive ad events for the InterstitialAd

◆ load() [2/2]

void load ( final InterstitialAdListener  interstitialAdListener)

Requests a new InterstitialAd.

Parameters
interstitialAdListenerthe InterstitialAd.InterstitialAdListener that will receive ad events for the InterstitialAd

◆ loadAdFromCache()

InterstitialAd loadAdFromCache ( final InterstitialAdListener  interstitialAdListener)

Attempts to load a InterstitialAd from the cache.

If the cache is empty, null is returned.

Parameters
interstitialAdListenerthe InterstitialAd.InterstitialAdListener that will receive ad events for the InterstitialAd
Returns
a InterstitialAd from the cache or null if the cache is empty

◆ prefetch()

void prefetch ( )

Initializes a cache replenishment request.

Note that if a request is already in progress or the cache is not below the replenishment threshold, no request will be made.

◆ requestBid()

static void requestBid ( final Context  context,
final String  placementId,
final RequestMetadata  requestMetadata,
final BidRequestListener  bidRequestListener 
)
static

Requests a bid for the opportunity to win the InterstitialAd impression.

Parameters
contextthe context in which the InterstitialAds will be loaded
placementIdplacementId that will be set for all InterstitialAds that the InterstitialAdFactory creates
requestMetadatathe RequestMetadata to use for ad requests
bidRequestListenerthe BidRequestListener that will receive bid request events

◆ setCacheReplenishmentThresholdOverride()

void setCacheReplenishmentThresholdOverride ( final int  cacheReplenishmentThresholdOverride)

Sets the cache replenishment threshold.

If the resulting cache size after an ad is loaded from the cache is less than or equal this value the factory will attempt to replenish the cache. Must be a non-negative integer. Max value is 30

Parameters
cacheReplenishmentThresholdOverridethe cache size threshold for triggering a replenishment

◆ setListener()

void setListener ( final InterstitialAdFactoryListener  adFactoryListener)

Set the InterstitialAdFactoryListener to receive ad factory event callbacks.

Parameters
adFactoryListenerthe InterstitialAdFactoryListener to set. Called when ad factory events occur.

◆ setRequestMetaData()

void setRequestMetaData ( final RequestMetadata  requestMetadata)

Sets a RequestMetadata object that overrides global RequestMetadata for the InterstitialAdFactory’s ad requests.

Parameters
requestMetadatathe RequestMetadata to use for ad requests