Help Center/Details/

Native Ads Interface Instruction

Introduction

  1. The BUNativeAd class provides various information. After obtaining the data, the developer can obtain the native ad assets from BUMaterialMeta.
  2. BUNativeAd class provides data binding of native ads and reporting of click events. Developers can define the display form and layout of information native feed-in ads.
  3. Use BUAdSlot to initialize a BUNativeAd object, and call the loadAdData:. Developers can get the ad data in BUMaterialMeta in the callback of nativeAdsManagerSuccessToLoad:.
  4. Developers can create the view of ad in advance, and render the ad style according to project requirements in the created view.
  5. Developers can use registerContainer:withClickableViews:clickableViews register and bind the view to be clicked, including images, buttons, etc.

Remark

  • The BUNativeAd registers View click events (jump to ad page, download, call, etc.) that are controlled by the SDK.
  • The specific click event type (BUInteractionType) comes from the data (BUMaterialMeta) obtained by BUNativeAd request
  1. If developers want to obtain the relevant data information of video ads, they need to initialize BUNativeAdRelatedView class to obtain the ad logo, dislike button, video view, etc.
  2. If the current dislike style does not meet the requirements of your project, you can refer to the BUDislike class to implement the dislike button style.

BUAdSlot

BUAdSlot Ad object is the ad description when loading the ad, it is required to be passed at the initialization stage in BUNativeAd, BUNativeAdsManager. The setup has to be done before loading the ad.

BUAdSlot Interface

Field Definition Field Name Field Type Remarks
ID slot ID NSString requied,space ad ID
AdType ad type BUAdSlotAdType requied parameters;BUAdSlotAdTypeUnknown = 0, BUAdSlotAdTypeBanner = 1, // banner ads BUAdSlotAdTypeInterstitial = 2, // interstitial ads BUAdSlotAdTypeSplash = 3, // splash ads BUAdSlotAdTypeSplash_Cache = 4, // cache splash ads BUAdSlotAdTypeFeed = 5, // feed ads BUAdSlotAdTypePaster = 6, // paster ads BUAdSlotAdTypeRewardVideo = 7, // rewarded video ads BUAdSlotAdTypeFullscreenVideo = 8, // full-screen video ads BUAdSlotAdTypeDrawVideo = 9, // vertical (immersive) video ads
imgSize Image size. BUSize // unit px;requied @property (nonatomic, assign) NSInteger width; @property (nonatomic, assign) NSInteger height;
dictionaryValue / NSDictionary /

BUMaterialMeta

You can obtain all of the ad properties in BUMaterialMeta.

BUMaterialMeta Interface

Field Definition Field Name Field Type Remarks
interactionType ad insteraction type BUInteractionType BUInteractionTypeCustorm = 0, BUInteractionTypeNO_INTERACTION = 1, // pure ad display BUInteractionTypeURL = 2, // open the webpage using a browser BUInteractionTypePage = 3, // open the webpage within the app BUInteractionTypeDownload = 4, // download the app BUInteractionTypePhone = 5, // make a call BUInteractionTypeMessage = 6, // send messages BUInteractionTypeEmail = 7, // send email BUInteractionTypeVideoAdDetail = 8 // video ad details page
imageAry material pictures. NSArray<BUImage *> material pictures.
icon ad logo icon. BUImage ad logo icon.
AdTitle ad headline. NSString ad headline.
AdDescription ad description. NSString ad description.
source ad source. NSString ad source.
buttonText text displayed on the creative button. NSString text displayed on the creative button.
imageMode display format of the in-feed ad, other ads ignores it. BUFeedADMode BUFeedADModeSmallImage = 2, BUFeedADModeLargeImage = 3, BUFeedADModeGroupImage = 4, BUFeedVideoAdModeImage = 5, // video ad || rewarded video ad horizontal screen BUFeedVideoAdModePortrait = 15, // rewarded video ad vertical screen BUFeedADModeImagePortrait = 16, BUFeedADModeSquareImage = 33, //SquareImage Currently it exists only in the oversea now. V3200 add BUFeedADModeSquareVideo = 50, //SquareVideo Currently it exists only in the oversea now. V3200 add
score Star rating NSInteger Star rating, range from 1 to 5.
commentNum Number of comments. NSInteger Number of comments.
videoDuration video duration NSInteger video duration
mediaExt media configuration parameters. NSDictionary media configuration parameters.

BUNativeAdRelatedView

You can add logo, ad label, video views, dislike buttons and so on in related view classes.
Logo and ad label is required to add to the Native ads. logoADImageView is recommended, it contains logo and ad label.

BUNativeAdRelatedView Interface

Field Definition Field Name Field Type Remarks
dislikeButton dislike button UIButton Need to actively add to the view in order to deal with the feedback and improve the accuracy of ad.
logoADImageView Ad logo + Promotion label. UIImageView Need to actively add to the view.
videoAdView Video ad view. BUVideoAdView Need to actively add to the view. Can not coexist with videoAdReportor.
refreshData:nativeAd / / Refresh the data every time you get new datas in order to show ad perfectly.

BUVideoAdView

BUVideoAdView provides methods such as play, pause, currentPlayTime, etc. Developers can apply it in Native ads to play or pause the ad, receive already played time through a click to resume the video, etc.

BUVideoAdView Interface

BUVideoAdView Interface Description
- (CGFloat)currentPlayTime; Get the already played time.
- (void)play; Set video play when you support CustomMode
- (void)pause; Set video pause when you support CustomMode
@property (nonatomic, weak, readwrite) UIViewController *rootViewController; required. Root view controller for handling ad actions.
@property (nonatomic, strong, readwrite, nullable) BUMaterialMeta *materialMeta; material information.
@property (nonatomic, assign) BOOL supportAutoPlay; Set your Video autoPlayMode when you support CustomMode if support CustomMode , default autoplay Video
initWithMaterial: /
playerSeekToTime: Resume to the corresponding time.
playerPlayIncon: playInconSize: Support configuration for pause button.

BUVideoAdViewDelegate Callback

BUVideoAdViewDelegate Description
videoAdView:didLoadFailWithError: This method is called when videoadview failed to play.
videoAdView: stateDidChanged: This method is called when videoadview playback status changed.
playerDidPlayFinish: This method is called when videoadview end of play.
videoAdViewDidClick: This method is called when videoadview is clicked.
videoAdViewFinishViewDidClick: This method is called when videoadview's finish view is clicked.
videoAdViewDidCloseOtherController: interactionType: This method is called when another controller has been closed. interactionType : open appstore in app or open the webpage or view video ad details page.

Instance:

self.videoAdView = [[BUVideoAdView alloc] init];
self.videoAdView.materialMeta = (BUMaterialMeta *)self.material;
self.videoAdView.rootViewController = self;
[self addSubview:self.videoAdView];

BUDislike

BUDislike class allow native ads to customize uninterested styles for rendering.

BUDislike interface

BUDislike interface Description
@property (nonatomic, copy, readonly) NSArray<BUDislikeWords *> *filterWords; The array of BUDislikeWords which have reasons for dislike. The application can show the secondary page for dislike if '[filterWords.options count] > 0'.
initWithNativeAd: Initialize with nativeAd to get filterWords. return BUDislike
didSelectedFilterWordWithReason: Call this method after the user chose dislike reasons. (Only for object which uses 'BUDislike.filterWords') filterWord : reasons for dislike don't need to call this method if '[filterWords.options count] > 0'. Please don't change 'BUDislike.filterWords'. 'filterWord' must be one of 'BUDislike.filterWords', otherwise it will be filtered.

Note:If you are to use the BUDislike class, make sure to call the interface(didSelectedFilterWordWithReason:) after users click.

Did the content solve your problem?