Show Sidebar

Requesting Native Ads – iOS SDK

Maaf, entri ini hanya tersedia dalam bahasa 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 library directory from among VMaxNativeAdTileHelperVMaxNativeContentStreamAdHelper,
    VMaxNativeIconAdHelperVMaxNativeInFeedAdHelper 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 to the ad view delegate as follows:

Objective C

Then one must request an ad via cacheAd as follows:

Objective C

Complete invocation code

Objective C

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

Objective C

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 VMaxNativeContentStreamAdViewusing nativeAd Object.

Integration of NativeAd using Tile Helper Library

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

 

Integration of NativeAd using Icon Helper Library

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

Native Custom Ads

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.

Example:

What would you like to do next?