English
Log In
You can then view all documents
Installation/iOS/Self-rendering basic module configuration instructions (information flow, Banner, interstitial, Draw
Self-rendering basic module configuration instructions (information flow, Banner, interstitial, Draw
Last updated 2022-01-24 14:44:09

Origin Rendering basic module configuration instructions (information flow, Banner, interstitial, Draw)

Introduction

  1. The BUNativeAd class provides various information such as the data type of the native advertisement. After obtaining the data, the developer can obtain the data information of the image advertisement in the attribute data (BUMaterialMeta), such as interactive advertisement types, pictures, advertisement logos, and advertisements. Description, title, etc.
  2. The BUNativeAd class provides data binding of native ads and reporting of click events. Developers can define the display form and layout of information flow ads by themselves.
  3. Use BUAdSlot to initialize a BUNativeAd object and call the loadAdData: method. Developers can get the advertisement data in BUMaterialMeta in the callback of successful advertisement pull.
  4. Developers can create the views that need to display advertisements in advance, and render the advertisement styles according to their own project requirements in the created views.
  5. Developers can use registerContainer:withClickableViews:clickableViews to register views that are bound to click, including pictures, buttons, and so on.
    Remarks:
    1. BUNativeAd registered view specific click events (jumping to the ad page, downloading, calling, etc.) behavior is controlled by the SDK.
    2. The specific click event type interactionType (BUInteractionType) comes from the data (BUMaterialMeta) requested by BUNativeAd
  6. If the developer wants to obtain the relevant data information of the video advertisement, he needs to initialize the BUNativeAdRelatedView class to obtain the advertisement logo, dislike button, video view, etc. that need to be added.
  7. If the current dislike style does not meet the needs of your own project, you can refer to the BUDislike class to implement the dislike button style yourself.
  8. If you need to add an advertising logo, dislike button, video view, etc., please initialize BUNativeAdRelatedView first.

Advertising slot class (BUAdSlot)

The BUAdSlot object is the ad slot description information that needs to be set when loading the ad, and it needs to be passed in during the initialization phase in BUNativeAd, BUNativeAdsManager, BUBannerAdView, and BUInterstitialAd. Before loading ads, it must be set up.

Remarks: Please use BUNativeAdsManager to request multiple pieces of advertising data at once

The BUNativeAd class is an interface class for loading advertisements. It can request one advertisement data at a time through the data interface, and can assist UIView to register and process various advertisement click events. After setting the delegate, the data can be obtained. The rootViewController is a mandatory parameter, which pops up the landing page advertisement ViewController.

BUAdSlot interface description

Field name

Field definition

Field type

Remarks

ID

Code bit

NSString

Required parameter, code bit ID

AdType

Ad Type

BUAdSlotAdType

Required parameters; BUAdSlotAdTypeUnknown = 0, BUAdSlotAdTypeBanner = 1, // bannar ad BUDSlotAdTypeInterstitial = 2, // interstitial ad BUDSlotAdTypeSplash = 3, // open screen ad BUAdSlotAdTypeSplash_Cache = 4, // cached Open screen ads BUAdSlotAdTypeFeed = 5, // Information flow ads BUAdSlotAdTypePaster = 6, // paster ads BUAdSlotAdTypeRewardVideo = 7, // Rewarded video ads BUAdSlotAdTypeFullscreenVideo = 8, // Full-screen video ads BUAdSlotAdTypeDrawVideo = 9, // Vertical (immersive) video advertise

position

Ad position

BUAdSlotPosition

Required parameters; BUAdSlotPositionTop = 1, BUAdSlotPositionBottom = 2, BUAdSlotPositionFeed = 3, BUAdSlotPositionMiddle = 4, // Only for interstitial ads BUAdSlotPositionFullscreen = 5,

imgSizeArray

A set of image sizes

NSMutableArray<BUSize *>

// Unit px; optional parameters @property (nonatomic, assign) NSInteger width; @property (nonatomic, assign) NSInteger height;

imgSize

Picture Size

BUSize

// Unit px; Required parameters @property (nonatomic, assign) NSInteger width;@property (nonatomic, assign) NSInteger height;

iconSize

logo size

BUSize

// unit px; optional parameters @property (nonatomic, assign) NSInteger width; @property (nonatomic, assign) NSInteger height;

titleLengthLimit

Title maximum length limit

NSInteger

Optional parameter; ad title maximum length limit

descLengthLimit

Description maximum length limit

NSInteger

Optional parameter; ad description maximum length limit

isOriginAd


BOOL

Native bannar ads and native interstitial ads are set to 1, other ad types are set to 0, and the default is 0.

dictionaryValue

/

NSDictionary

/

Advertising data class (BUMaterialMeta)

The carrier class of advertisement data is BUMaterialMeta, and all advertisement attributes can be obtained by visiting.

BUMaterialMeta interface description

Field name

Field definition

Field type

Remarks

interactionType

Ad interaction type

BUInteractionType

BUInteractionTypeCustorm = 0,BUInteractionTypeNO_INTERACTION = 1, // Pure advertising display BUInteractionTypeURL = 2, // Use a browser to open the webpage BUInteractionTypePage = 3, // Open the webpage in the app BUInteractionTypeDownload = 4, // Download appBUInteractionTypePhone = 5, // call BUInteractionTypeMessage = 6, // send a message BUInteractionTypeEmail = 7, // send an email BUInteractionTypeVideoAdDetail = 8 // video ad details page

imageAry

material picture

NSArray<BUImage *>

material picture

icon

logo logo

BUImage

logo logo

AdTitle

Ad Title

NSString

Ad Title

AdDescription

Ad description

NSString

Ad description

source

Ad source

NSString

Ad source

buttonText

Text Button

NSString

Text Button

imageMode

Information flow advertising mode

BUFeedADMode

Only used for information flow advertising, other ads ignore this attributeBUFeedADModeSmallImage = 2, //Small image BUFeedADModeLargeImage = 3, //Large image BUFeedADModeGroupImage = 4, //Group image BUFeedVideoAdModeImage = 5, // Video Ads

score

star rating

NSInteger

rating standard 1~5

commentNum

Number of Comments

NSInteger

Number of Comments

appSize

Ad installation package size

NSInteger

Ad installation package size, unit byte

videoDuration

Video duration

NSInteger

Video duration

mediaExt

Transmission parameters

NSDictionary

Transmission parameters

Related View Class (BUNativeAdRelatedView)

Related view categories can add logos, advertising tags, video views, dislike buttons, etc.

BUNativeAdRelatedView interface description

Field name

Field definition

Field type

Remarks

dislikeButton

dislike button

UIButton

You need to actively add views, accept user feedback, and improve the accuracy of advertising.

adLabel

Ad Label

UILabel

Advertising label, need to be actively added to the view.

logoImageView

Advertising logo

UIImageView

Advertising logo, need to be actively added to the view.

logoADImageView

Advertising logo+Advertising logo

UIImageView

Advertising logo+Advertising logo, need to be actively added to the view.

videoAdView

Video View

BUVideoAdView

Video View must be actively added to the view.

refreshData:nativeAd

/

/

Refresh data callback method; Note: Add logo, advertising label, video view, dislike button, each time you obtain material information, you need to refresh the call-(void)refreshData:(BUNativeAd * The nativeAd method refreshes the data bound to the corresponding view.

Video View (BUVideoAdView)

BUVideoAdView provides play, pause, currentPlayTime and other methods, which can be used by developers in the information flow to realize automatic playback when entering the screen, pause when entering the screen, and click to pass in the elapsed time for replay.

BUVideoAdView interface description

Callback Method

Notes

- (CGFloat)currentPlayTime;

How to get the playback progress (current time)

- (void)play;

Play method

- (void)pause;

Pause method

@property (nonatomic, weak, readwrite) UIViewController *rootViewController;

Required parameters; set rootViewController, the carrier of advertising jumps, and the root view controller.

@property (nonatomic, assign) BOOL drawVideoClickEnable;

Whether click to pause the video is allowed, the default is NO. Only used for Draw video ads (immersive ads)

@property (nonatomic, strong, readwrite, nullable) BUMaterialMeta *materialMeta;

BUMaterialMeta advertising data carrier class, used to get all the attributes of the advertisement

@property (nonatomic, assign) BOOL supportAutoPlay;

Whether to support auto play, custom mode of video ads, auto play is supported by default

InitWithMaterial:/playerSeekToTime:

How to restore video progress

playerPlayIncon: playInconSize:

Custom Pause Button Style Method

BUVideoAdViewDelegate callback description

Callback Method

Notes

videoAdView:didLoadFailWithError:videoAdView

This method is called when the playback fails; the returned error code (error) indicates the reason for the playback failure. Please refer to the link for details of all error codes. Link

videoAdView: stateDidChanged:

This method is called when the videoAdView playback state changes. playerState: the changed state

playerDidPlayFinish:

Call this method when playback is complete

videoAdViewDidClick:videoAdView

Click callback method, click on the video area will trigger this callback method

videoAdViewFinishViewDidClick:

This method is called when the finish view of videoAdView is clicked

videoAdViewDidCloseOtherController: interactionType

: This callback is called when the ad jumps to another controller, and the controller is closed. InteractionType: This parameter can be distinguished from the opened appstore/webpage/video ad details page

BUVideoAdView initialization example

复制

Not Interested Class (BUDislike)

The style of the dislike button can be customized through the BUDislike class.

BUDislike interface description

Callback Method

Notes

Other instructions

@property (nonatomic, copy, readonly) NSArray<BUDislikeWords *> *filterWords;

BUDislikeWords array can display the second page if [filterWords.options count]> 0

-

initWithNativeAd:

Initialize with nativeAd to get filterWords and return BUDislike

-

didSelectedFilterWordWithReason:

1) This method is called after the user selects the reason for dislike. (Only applicable to objects using'BUDislike.filterWords') 2) If'[filterWords.options count]> 0'. There is no need to call this method. 3)'BUDislike.filterWords' cannot be changed, filterWord must be one of BUDislike, otherwise it will be filtered.

-

nativeAd: adContainerViewDidRemoved:

Callback for forced closing of information flow ads. Media needs to do the closing related processing here to avoid abnormal page layout


Note: Use the BUDislike class to ensure that the user clicks to call the interface (didSelectedFilterWordWithReason:) Report the reason


Contents
Contact us