Show Sidebar

Requesting Banner Ads – iOS SDK

Rất tiếc, mục này chỉ tồn tại ở English. For the sake of viewer convenience, the content is shown below in the alternative language. You may click the link to switch the active language.

For Banner Ads, please ensure that you have turned off the refresh from the mediation partner’s web interface when using a fresh integration of VMAX SDK 3.4.0 or higher. This change in settings is not required when updating from an earlier version to 3.4.0 or higher.
Note: For banners, please use the loadAd() API. Banners will automatically refresh after 30 seconds.

To request a banner

Create an instance of the VMaxAdView for Banner Ads and conform to the delegate.

Creating the Ad View

Objective CSwift

Set the frame of the AdView

Set the Frame for VMaxAdView prior to calling any methods of VMaxAdSDK in order to display ads properly. For a typical 320×50 ad placed at the bottom of the view, the code is as follows:

Objective CSwift

[Optional] Setting Custom Refresh Rate

Set an Ad Refresh rate greater than the default of 30 seconds.
Note 1: The minimum Ad Refresh rate is 30 seconds; setting a lower value will default to 30 seconds.
Note 2: Refresh rate is valid for Banner Ads only; Billboard Ads are not supported

Objective CSwift

[Optional] Setting the User Details

Set the User details for appropriate ad delivery.

Objective C

Setting the Request Timeout

Set the Request Timeout of Ads greater than the default Timeout of 20 seconds.
Note: The minimum Request Timeout is 20 seconds; setting a lower value will default to 20 seconds.

Objective CSwift

Requesting Ads with Orientation

To Request an Ad with Orientation use the loadAdWithOrientation method from the Required_Orientation_From_EnumVMaxAdOrientation.

Possible Orientation Values

Objective CSwift


Manual Caching

To have greater control over Ad Display, use the Manual Caching and displaying. This method disables Auto refresh property. To cache an Ad with Orientation use the cacheAdWithOrientation method from Required__Orientation_From_Enum VMaxAdOrientation.

On Successful caching the following delegate will be called. Note that at this point the Ad is cached in the background and not visible to user. To make Ad visible, call showAd.

From 3.6.0

Objective C

Before 3.6.0

Objective C

Knowing Ad States

From 3.6.0, refer the upgrade document for ad states.

Before 3.6.0

Customizable Ad Properties

Possible Values

Objective C

Note: Config is a dictionary with following Keys

AdView APIs

To request Billboard Ads

To request billboard ads, create a new adView instance and set it’s UX Type to kVMaxAdUX_Billboard.
For example,

Objective CSwift

To request and customize billboard ads, follow the procedure for banner ads. Replace kVMaxAdUX_Banner with kVMaxAdUX_Billboard when using Objective-C and replace VMaxAdUX.Banner with VMaxAdUX.Billboard when using Swift.

Ad View Delegate Syntax (before 3.6.0)

Objective CSwift

What would you like to do next?