AdColonyNativeAdView Class Reference
Inherits from | UIView |
---|---|
Declared in | AdColonyNativeAdView.h |
Overview
AdColonyNativeAdViews are used to display non-fullscreen AdColony ads in a fashion that matches the look-and-feel of your application;
it contains the video and engagement components of the native ad and manages the display and playback of the video.
Event handler block properties are provided so your app can react to ad-level events such as a open or close.
The object also exposes additional information about the advertisement that is intended to be displayed alongside the video.
The native ad may include an engagement button which is fully customizable by the publisher.
Instances of this class should not be initialized directly; instead, use the AdColonyNativeAdView passed back the success handler in
[AdColony requestNativeAdViewInZone:size:options:viewController:success:failure:]
.
Zone
zoneID
Represents the unique zone identifier string from which the AdColonyNativeAdView was requested.
@property (nonatomic, readonly) NSString *zoneID
Discussion
AdColony zone IDs can be created at the Control Panel.
Declared In
AdColonyNativeAdView.h
Ad Lifecycle
started
Indicates whether or not the AdColonyNativeAdView has begun displaying its video content in response to being displayed on screen.
@property (nonatomic, readonly) BOOL started
Discussion
This property will be set to YES
if the in-feed video has started playback.
Declared In
AdColonyNativeAdView.h
finished
Indicates whether or not the AdColonyNativeAdView has finished displaying its video content in response to being displayed on screen.
@property (nonatomic, readonly) BOOL finished
Discussion
This property will be set to YES
if the in-feed video has completed playback.
Declared In
AdColonyNativeAdView.h
opened
Indicates whether or not the AdColonyNativeAdView has been expanded to fullscreen mode.
@property (nonatomic, readonly) BOOL opened
Discussion
This property will be set to YES
if the in-feed video has been expanded to fullscreen.
Declared In
AdColonyNativeAdView.h
Creative Content and User Interface
advertiserName
Represents the name of the advertiser for this ad. Approximately 25 characters.
@property (nonatomic, readonly) NSString *advertiserName
Discussion
AdColony requires this to be displayed alongside the AdColonyNativeAdView.
Declared In
AdColonyNativeAdView.h
advertiserIcon
Represents the advertiser’s icon for this ad (may be nil
).
@property (nonatomic, readonly, nullable) UIImage *advertiserIcon
Discussion
Typically 200x200 pixels for Retina display at up to 100x100 screen points. Display of this image is optional.
Declared In
AdColonyNativeAdView.h
adTitle
Represents a short title for this ad.
@property (nonatomic, readonly) NSString *adTitle
Discussion
Approximately 25 characters. Display of this string is optional.
Declared In
AdColonyNativeAdView.h
adDescription
Represents a mid-length description of this ad.
@property (nonatomic, readonly) NSString *adDescription
Discussion
Up to approximately 90 characters. Display of this string is optional.
Declared In
AdColonyNativeAdView.h
engagementButton
Represents the engagement button for this ad (may be nil
). This is automatically displayed beneath the video component.
@property (nonatomic, strong, nullable) UIButton *engagementButton
Discussion
Leverage this property to access the UIButton and customize anything about it except its title text and tap action.
Declared In
AdColonyNativeAdView.h
Audio
volume
Represents the volume level of the video component of the ad. Defaults to 0.05f.
@property (nonatomic) float volume
Discussion
Leverage this property to set the volume of the native ad.
Declared In
AdColonyNativeAdView.h
muted
Indicates whether or not the video component of the ad is muted. Defaults to NO.
@property (nonatomic) BOOL muted
Discussion
Defaults to NO
. Leverage this property to determine if the native ad is muted or not.
Declared In
AdColonyNativeAdView.h
IAP
iapEnabled
Represents the unique zone identifier string from which the AdColonyNativeAdView was requested.
@property (nonatomic, readonly) BOOL iapEnabled
Discussion
AdColony zone IDs can be created at the Control Panel.
Declared In
AdColonyNativeAdView.h
Event Handlers
– setStart:
Notifies your app that a native ad has begun displaying its video content in response to being displayed on screen.
- (void)setStart:(nullable void ( ^ ) ( void ))start
Parameters
start |
The block of code to be executed. |
---|
Discussion
Note that the associated code block will be dispatched on the main thread.
Declared In
AdColonyNativeAdView.h
– setFinish:
Notifies your app that a native ad has finished displaying its video content in response to being displayed on screen.
- (void)setFinish:(nullable void ( ^ ) ( void ))finish
Parameters
finish |
The block of code to be executed. |
---|
Discussion
Note that the associated code block will be dispatched on the main thread.
Declared In
AdColonyNativeAdView.h
– setOpen:
Notifies your app that a native ad has been expanded to fullscreen mode.
- (void)setOpen:(nullable void ( ^ ) ( void ))open
Parameters
open |
The block of code to be executed. |
---|
Discussion
Within the handler, apps should implement app-specific code such as pausing app music if appropriate. Note that the associated code block will be dispatched on the main thread.
Declared In
AdColonyNativeAdView.h
– setClose:
Notifies your app that a native ad finished displaying its video content.
- (void)setClose:(void ( ^ ) ( void ))close
Parameters
close |
The block of code to be executed. |
---|
Discussion
Within the handler, apps should implement app-specific code such as resuming app music if appropriate. Note that the associated code block will be dispatched on the main thread.
Declared In
AdColonyNativeAdView.h
– setIapOpportunity:
Sets the block of code to be executed when the ad triggers an IAP opportunity.
- (void)setIapOpportunity:(nullable void ( ^ ) ( NSString *iapProductID , AdColonyIAPEngagement engagement ))iapOpportunity
Parameters
iapOpportunity |
The block of code to be executed. |
---|
Discussion
Note that the associated code block will be dispatched on the main thread.
Declared In
AdColonyNativeAdView.h
– setEngagement:
Notifies your app that a user has engaged with the native ad via an in-video engagement mechanism.
- (void)setEngagement:(void ( ^ ) ( BOOL expanded ))engagement
Parameters
engagement |
The block of code to be executed. |
---|
Discussion
Note that the associated code block will be dispatched on the main thread.
Declared In
AdColonyNativeAdView.h
– setLeftApplication:
Sets the block of code to be executed when an action causes the user to leave the application.
- (void)setLeftApplication:(nullable void ( ^ ) ( void ))leftApplication
Parameters
leftApplication |
The block of code to be executed. |
---|
Discussion
Note that the associated code block will be dispatched on the main thread.
Declared In
AdColonyNativeAdView.h
– setClick:
Sets the block of code to be executed when the user taps on the interstitial ad, causing an action to be taken.
- (void)setClick:(nullable void ( ^ ) ( void ))click
Parameters
click |
The block of code to be executed. |
---|
Discussion
Note that the associated code block will be dispatched on the main thread.
Declared In
AdColonyNativeAdView.h
Playback
– pause
Pauses the video component of the native ad if it is currently playing.
- (void)pause
Discussion
This should be used when the native ad goes off-screen temporarily: for example, when it is contained in a UITableViewCell that has been scrolled off-screen;
or when the ad is contained in a UIViewController and that view controller has called the method viewWillDisappear
.
Note that any use of this method must be paired with a corresponding call to resume
.
Declared In
AdColonyNativeAdView.h
– resume
Resumes the video component of the native ad if it has been paused.
- (void)resume
Discussion
This should be used when a native ad that was off-screen temporarily has come back on-screen;
for example, when the ad is contained in a UIViewController and that view controller has called the method viewWillAppear
.
Note that this method must be used to undo a previous corresponding call to pause
.
Declared In
AdColonyNativeAdView.h
– destroy
Indicates that the AdColonyNativeAdView has been removed from the view hierarchy and should be destroyed.
- (void)destroy
Discussion
The AdColony SDK maintains internal resources when the ad is being displayed. When this method is called, all internal resources are destroyed and the associated memory is freed.
Declared In
AdColonyNativeAdView.h