iOS Verizon Ads SDK Standard Edition Documentation
1.14
|
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< VASInlineAdFactoryDelegate > | delegate |
The object implementing the VASInlineAdFactoryDelegate protocol, to receive ad factory event callbacks. | |
NSString * | placementId |
Get the placementId for the VASInlineAdFactory. | |
VASRequestMetadata * | requestMetadata |
The VASRequestMetadata object that overrides global VASRequestMetadata for the VASInlineAdFactory ad requests. | |
VASInlineAdFactory is a factory class that handles loading and caching of VASInlineAdView placements.
It uses the VASInlineAdFactoryDelegate protocol to provide notifications about VASInlineAdView creation.
- (void) destroy |
Frees the internal resources held by the factory.
The instance cannot be used after this method is called.
- (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.
placementId | The placementId that will be set for all VASInlineAdView that the VASInlineAdFactory creates. |
adSizes | The ad sizes supported by the inline placement (size is specified in dips). |
vasAds | The VASAds instance for this object to use. |
delegate | The VASInlineAdFactoryDelegate that will receive ad factory events for the VASInlineAdFactory. |
- (void) load: | (id< VASInlineAdViewDelegate >) | inlineAdDelegate |
Requests a new VASInlineAdView.
inlineAdDelegate | The VASInlineAdViewDelegate that will receive ad events for the VASInlineAdView. |
- (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.
inlineAdDelegate | The VASInlineAdViewDelegate that will receive ad events for the VASInlineAdView. |
- (void) loadBid: | (VASBid *) | bid | |
inlineAdDelegate: | (id< VASInlineAdViewDelegate >) | inlineAdDelegate | |
Loads the VASInlineAdView for the provided bid.
bid | The Bid that will be loaded. |
inlineAdDelegate | The VASInlineAdViewDelegate that will receive ad events for the VASInlineAdView. |
- (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.
+ (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.
placementId | The placementId that will be set for all VASInlineAdView that the VASInlineAdFactory creates. |
adSizes | The ad sizes that are supported by the VASInlineAdView that the VASInlineAdFactory creates. |
requestMetadata | The VASRequestMetadata to use for ad requests. |
vasAds | The VASAds instance for this object to use. |
handler | The completion handler that will receive the bid request result. |
|
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.