Show Sidebar

Requesting Native Ads – iOS SDK

Sorry, this entry is only available in 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.

Native Helper Libraries

The VMAX Native Ad Helper Libraries have been designed to reduce the efforts of the developer in rendering the native ads. The libraries help in rendering native ads in any one of the four formats:

  1. In-feed
  2. Content Stream
  3. Tile
  4. Icon

Adding helper libraries to your project

  1. Extract the iOS SDK zip file to a suitable location.
  2. Locate the VMaxNativeAdHelper folder inside the extracted native iOS SDK directory.
  3. Based on your requirement, import the required helper librarydirectory from among VMaxNativeAdTileHellperVMaxNativeContentStreamAdHelperVMaxNativeIconAdHelperVMaxNativeInFeedAdHelper into your Xcode project. Each directory further contains the headers, static lib and resources bundle required to function.
  4. Select the appropriate Target membership via ‘Add to targets’ during import.

Refer the VMaxSample Xcode project located inside the iOS SDK zip to see the helper library usage in action. Alternatively, refer the guides below for step by step detail.

Fetching a native ad

Create a native ad view & conform as the ad view delegate as follows:

Objective-CSwift

Then one must request an ad via cacheAd as follows:

Objective-CSwift

Complete invocation code

Objective-CSwift

On caching success, the following callback is invoked using which, further customisation is possible as illustrated below:

From 3.6.0

Objective-CSwift

Before 3.6.0

Objective-CSwift

From 3.6.0

Using the In-feed Helper Library

  1. Import VMaxNativeInFeedAdHelper folder into your project
  2. Create instance of VMaxNativeInFeedAdView using nativeAd Object

Integration of NativeAd using Content Stream Helper Library

  1. Import VMaxNativeContentStreamAdHelper folder into your project
  2. Create instance of VMaxNativeContentStreamAdView using nativeAd Object

Integration of NativeAd using Tile Helper Library

  1. Import VMaxNativeTileAdHelper folder into your project
  2. Create instance of VMaxNativeTileAdView using adView Object

Integration of NativeAd using Icon Helper Library

  1. Import VMaxNativeIconAdHelper folder into your project
  2. Create instance of VMaxNativeIconAdView using nativeAd Object
Confirm to VMaxAdDelegate & VMaxNativeAdDelegate for getting following callbacks:
Before 3.6.0

Using the In-feed Helper Library

  1. Import VMaxNativeInFeedAdHelper folder into your project
  2. Create instance of VMaxNativeInFeedAdView using nativeAd Object
Confirm to VMaxNativeInFeedAdViewDelegate for getting following callbacks:

Integration of NativeAd using Content Stream Helper Library

  1. Import VMaxNativeContentStreamAdHelper folder into your project
  2. Create instance of VMaxNativeContentStreamAdView using nativeAd Object
Confirm to VMaxNativeContentStreamAdViewDelegate for getting following callbacks:

Integration of NativeAd using Tile Helper Library

  1. Import VMaxNativeTileAdHelper folder into your project
  2. Create instance of VMaxNativeTileAdView using nativeAd Object
Confirm to VMaxNativeTileAdViewDelegate for getting following callbacks:

Integration of NativeAd using Icon Helper Library

  1. Import VMaxNativeIconAdHelper folder into your project
  2. Create instance of VMaxNativeIconAdView using nativeAd Object
Confirm to VMaxNativeIconAdViewDelegate for getting following callbacks:

Alternative Method

Start an instance of the Ad SDK for Native Ads and set the Delegate.

Cache the Native Ad.
The below API is mandatory for registering the view for impression record and for click registering. Make sure to call below api once Native AD view is visible in your application.
Parameters: adView is mandatory for proper handling of Native Ads view is mandatory so as to set listener , it can be parent view or layout or any view listOfViews is mandatory if click on multiple views required. If listOfViews is provided than third argument View view should be parent of the view available in list.

What would you like to do next?