PMNativeAd

Document created by catherine.racette on Sep 12, 2017Last modified by david.simerly on Nov 6, 2017
Version 4Show Document
  • View in full screen mode

Return to list of References

Inherits from:NSObject
Declared in:PMNativeAd.h

Overview

The PMNativeAd class used for requesting Native ads from PubMatic


Tasks

– trackViewForInteractions:withViewController:

– loadInImageView:withURL:

– destroy

  delegate property

  useInternalBrowser property

– execute:

  adAssetResponseArray property


Properties


adAssetResponseArray

When PMNativeAd done with ad fetching from PubMatic server, All requested native ad assets will be available in adAssetResponseArray. It can contain objects of PMNativeDataAssetResponse, PMNativeImageAssetResponse, PMNativeTitleAssetResponse based on requested assets

@property (nonatomic, readonly) NSArray<PMNativeAssetResponse*> *adAssetResponseArray

Discussion

When PMNativeAd done with ad fetching from PubMatic server, All requested native ad assets will be available in adAssetResponseArray. It can contain objects of PMNativeDataAssetResponse, PMNativeImageAssetResponse, PMNativeTitleAssetResponse based on requested assets

Declared In

PMNativeAd.h

delegate

abstract Sets the PMNativeAdDelegate delegate receiver for the PMNativeAd.

@property (nonatomic, weak) id<PMNativeAdDelegate> delegate

Discussion

abstract Sets the PMNativeAdDelegate delegate receiver for the PMNativeAd.

Warnings:

Proper reference management practices should be observed when using delegates.

 

Ensure that the delegate is set to nil prior to setting nil to PMNativeAd object reference

Declared In

PMNativeAd.h

useInternalBrowser

Set to enable the use of the internal browser for opening ad content. Defaults to NO.

@property (nonatomic, assign) BOOL useInternalBrowser

Discussion

Set to enable the use of the internal browser for opening ad content. Defaults to NO.

Declared In

PMNativeAd.h

Instance Methods

destroy

Method will be used to destroy instance of native ad and hence free resources. This method is to be called only when native ad is supposed to be deallocated.

- (void)destroy

Discussion

Method will be used to destroy instance of native ad and hence free resources. This method is to be called only when native ad is supposed to be deallocated.

Declared In

PMNativeAd.h

execute:

Issues an request to fetch new native ad.

- (void)execute:(PMBaseAdRequest *)adRequest

Parameters

adRequest

Native Ad request

Discussion

Issues an request to fetch new native ad.

Declared In

PMNativeAd.h

loadInImageView:withURL:

Method will asyncronously download and hence render image in imageView. This method can be used for rendering icon and cover image

- (void)loadInImageView:(UIImageView *)imageView withURL:(NSString *)urlString

Parameters

imageView

Image View where image is to be rendered

urlString

URL of image which is to be rendered

Discussion

Method will asyncronously download and hence render image in imageView. This method can be used for rendering icon and cover image

Declared In

PMNativeAd.h

trackViewForInteractions:withViewController:

Method to be called once native ad is sucessfully rendered for sending sucess metric url and hence handling user clicks

- (void)trackViewForInteractions:(UIView *)view withViewController:(UIViewController *)viewController

Parameters

view

Native Ad View where all native ad components are rendered

viewController

Viewcontroller on which native ad is placed

Discussion

Method to be called once native ad is sucessfully rendered for sending sucess metric url and hence handling user clicks

Declared In

PMNativeAd.h

Attachments

    Outcomes