iOS Verizon Ads SDK Standard Edition Documentation  1.14
Instance Methods | Class Methods | Properties | List of all members
VASInterstitialAdFactory Class Reference

VASInterstitialAdFactory is a factory class that handles loading and caching of VASInterstitialAd placements. More...

#import <VASInterstitialAdFactory.h>

Inherits NSObject.

Instance Methods

(void) - abortLoad
 Aborts any load requests that are still active.
 
(void) - destroy
 Frees the internal resources held by the factory. More...
 
(instancetype) - initWithPlacementId:vasAds:delegate:
 Initialize an VASInterstitialAdFactory for creating VASInterstitialAd objects. More...
 
(void) - load:
 Requests a new VASInterstitialAd. More...
 
(nullable VASInterstitialAd *) - loadAdFromCache:
 Attempts to load a VASInterstitialAd from the cache. More...
 
(void) - loadBid:interstitialAdDelegate:
 Loads the VASInterstitialAd for the provided bid. More...
 
(void) - prefetch
 Initializes a cache replenishment request. More...
 

Class Methods

(void) + requestBidForPlacementId:requestMetadata:vasAds:completionHandler:
 Requests a bid for the provided placement Id. More...
 

Properties

NSUInteger cacheReplenishmentThresholdOverride
 Gets or sets the cache replenishment threshold override for this instance of the factory, which will then be used instead of SDK configuration or the default value. More...
 
id< VASInterstitialAdFactoryDelegatedelegate
 The object implementing the VASInterstitialAdFactoryDelegate protocol, to receive ad factory event callbacks.
 
NSStringplacementId
 Get the placementId for the VASInterstitialAdFactory.
 
VASRequestMetadatarequestMetadata
 The VASRequestMetadata object that overrides global VASRequestMetadata for the VASInterstitialAdFactory ad requests.
 

Detailed Description

VASInterstitialAdFactory is a factory class that handles loading and caching of VASInterstitialAd placements.

It uses the VASInterstitialAdFactoryDelegate protocol to provide notifications about VASInterstitialAd creation.

Method Documentation

◆ destroy

- (void) destroy

Frees the internal resources held by the factory.

The instance cannot be used after this method is called.

◆ initWithPlacementId:vasAds:delegate:

- (instancetype) initWithPlacementId: (NSString *)  placementId
vasAds: (VASAds *)  vasAds
delegate: (nullable id< VASInterstitialAdFactoryDelegate >)  delegate 

Initialize an VASInterstitialAdFactory for creating VASInterstitialAd objects.

Use this to set the placementId and listener for VASInterstitialAd that the VASInterstitialAdFactory will create.

Parameters
placementIdThe placementId that will be set for all VASInterstitialAd that the VASInterstitialAdFactory creates.
vasAdsThe VASAds instance for this object to use.
delegateThe VASInterstitialAdFactoryDelegate that will receive ad factory events for the VASInterstitialAdFactory.
Returns
An initialized instance of this class.

◆ load:

- (void) load: (id< VASInterstitialAdDelegate >)  interstitialAdDelegate

Requests a new VASInterstitialAd.

Parameters
interstitialAdDelegatethe VASInterstitialAdDelegate that will receive ad events for the VASInterstitialAd.

◆ loadAdFromCache:

- (nullable VASInterstitialAd *) loadAdFromCache: (id< VASInterstitialAdDelegate >)  interstitialAdDelegate

Attempts to load a VASInterstitialAd from the cache.

If the cache is empty, nil is returned.

Parameters
interstitialAdDelegateThe VASInterstitialAdDelegate that will receive ad events for the VASInterstitialAd.
Returns
A VASInterstitialAd from the cache or nil if the cache is empty.

◆ loadBid:interstitialAdDelegate:

- (void) loadBid: (VASBid *)  bid
interstitialAdDelegate: (id< VASInterstitialAdDelegate >)  interstitialAdDelegate 

Loads the VASInterstitialAd for the provided bid.

Parameters
bidThe Bid that will be loaded.
interstitialAdDelegateThe VASInterstitialAdDelegate that will receive ad events for the VASInterstitialAd.

◆ 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.

◆ requestBidForPlacementId:requestMetadata:vasAds:completionHandler:

+ (void) requestBidForPlacementId: (NSString *)  placementId
requestMetadata: (nullable VASRequestMetadata *)  requestMetadata
vasAds: (VASAds *)  vasAds
completionHandler: (VASBidRequestCompletionHandler)  handler 

Requests a bid for the provided placement Id.

Parameters
placementIdThe placementId that will be set for all VASInterstitialAd that the VASInterstitialAdFactory creates.
requestMetadataThe VASRequestMetadata to use for ad requests.
vasAdsThe VASAds instance for this object to use.
handlerThe completion handler that will receive the bid request result.

Property Documentation

◆ cacheReplenishmentThresholdOverride

- (NSUInteger) cacheReplenishmentThresholdOverride
readwriteatomic

Gets or sets the cache replenishment threshold override for this instance of the factory, which will then be used instead of SDK configuration or the default value.

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