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

VASInlineAdFactory is a factory class that handles loading and caching of VASInlineAdView placements. More...

#import <VASInlineAdFactory.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:adSizes:vasAds:delegate:
 Initialize a VASInlineAdFactory for creating VASInlineAdView objects. More...
 
(void) - load:
 Requests a new VASInlineAdView. More...
 
(nullable VASInlineAdView *) - loadAdFromCache:
 Attempts to load a VASInlineAd from the cache. More...
 
(void) - loadBid:inlineAdDelegate:
 Loads the VASInlineAdView for the provided bid. More...
 
(void) - prefetch
 Initializes a cache replenishment request. More...
 

Class Methods

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

Properties

NSArray< VASInlineAdSize * > * adSizes
 Returns the ad sizes supported by this ad factory.
 
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< VASInlineAdFactoryDelegatedelegate
 The object implementing the VASInlineAdFactoryDelegate protocol, to receive ad factory event callbacks.
 
NSStringplacementId
 Get the placementId for the VASInlineAdFactory.
 
VASRequestMetadatarequestMetadata
 The VASRequestMetadata object that overrides global VASRequestMetadata for the VASInlineAdFactory ad requests.
 

Detailed Description

VASInlineAdFactory is a factory class that handles loading and caching of VASInlineAdView placements.

It uses the VASInlineAdFactoryDelegate protocol to provide notifications about VASInlineAdView 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:adSizes:vasAds:delegate:

- (instancetype) initWithPlacementId: (NSString *)  placementId
adSizes: (NSArray< VASInlineAdSize * > *)  adSizes
vasAds: (VASAds *)  vasAds
delegate: (nullable id< VASInlineAdFactoryDelegate >)  delegate 

Initialize a VASInlineAdFactory for creating VASInlineAdView objects.

Use this to set the placementId and listener for VASInlineAdView that the VASInlineAdFactory will create.

Parameters
placementIdThe placementId that will be set for all VASInlineAdView that the VASInlineAdFactory creates.
adSizesThe ad sizes supported by the inline placement (size is specified in dips).
vasAdsThe VASAds instance for this object to use.
delegateThe VASInlineAdFactoryDelegate that will receive ad factory events for the VASInlineAdFactory.
Returns
An initialized instance of this class.

◆ load:

- (void) load: (id< VASInlineAdViewDelegate >)  inlineAdDelegate

Requests a new VASInlineAdView.

Parameters
inlineAdDelegateThe VASInlineAdViewDelegate that will receive ad events for the VASInlineAdView.

◆ loadAdFromCache:

- (nullable VASInlineAdView *) loadAdFromCache: (id< VASInlineAdViewDelegate >)  inlineAdDelegate

Attempts to load a VASInlineAd from the cache.

If the cache is empty, nil is returned. This method performs UIView activity and therefore must be called from the main thread. If called outside the main thread, nil will be returned.

Parameters
inlineAdDelegateThe VASInlineAdViewDelegate that will receive ad events for the VASInlineAdView.
Returns
A VASInlineAdView from the cache or nil if the cache is empty or if the call is not made on the main thread.

◆ loadBid:inlineAdDelegate:

- (void) loadBid: (VASBid *)  bid
inlineAdDelegate: (id< VASInlineAdViewDelegate >)  inlineAdDelegate 

Loads the VASInlineAdView for the provided bid.

Parameters
bidThe Bid that will be loaded.
inlineAdDelegateThe VASInlineAdViewDelegate that will receive ad events for the VASInlineAdView.

◆ 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:adSizes:requestMetadata:vasAds:completion:

+ (void) requestBidForPlacementId: (NSString *)  placementId
adSizes: (NSArray< VASInlineAdSize * > *)  adSizes
requestMetadata: (nullable VASRequestMetadata *)  requestMetadata
vasAds: (VASAds *)  vasAds
completion: (VASBidRequestCompletionHandler)  handler 

Requests a bid for the provided placement Id.

Parameters
placementIdThe placementId that will be set for all VASInlineAdView that the VASInlineAdFactory creates.
adSizesThe ad sizes that are supported by the VASInlineAdView that the VASInlineAdFactory 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.