English
Log In
You can then view all documents
Installation/iOS/Template rendering Banner
Template rendering Banner
Last updated 2022-01-19 23:18:51

Template rendering Banner

Introduction

Template rendering Banner: It is a small bar advertisement displayed at the bottom or top of the content. Banner ads should not be placed in text, images and other clickable parts of the application to avoid mistakes

Supported ad sizes: Supports 8 sizes including 600*300, 600*400, 600*500, 600*260, 600*90, 600*150, 640*100, 690*388 , The developer selects according to the display scene. The created size does not support modification

Permission:

**Template Banner Ads: ** Provided by default

Carousel settings

  1. When carousel: Yes When the carousel function is selected, the client does not need to implement the operation of re-requesting at a certain interval by itself. The carousel function is implemented internally by the SDK. The client only needs to ensure that the advertisement is displayed in time. Carousel interval is between 30s~120s
  2. When carousel: No When the carousel function is not selected, the client can realize the carousel effect by itself, such as re-requesting advertisements at a certain interval to ensure that the advertisement content is new content within a certain interval. The ad request interval is recommended to be consistent with the carousel function implemented by the platform, and the request interval is between 30s and 120s

Template Banner Ads

Instructions for use

The template banner uses the BUNativeExpressBannerView object to call loadAdData to request the advertisement, and uses addSubview to add the advertisement object to display the advertisement. By setting the BUNativeExpressBannerViewDelegate agent, get the advertisement, display, click, and close Wait for callback.

Create an ad slot object, request an ad

BUNativeExpressBannerView

You need to pass in the ad slot object when requesting an ad, and the ad slot ID must be passed in when the ad slot object is created

Required parameters:

Field name

Field definition

Field type

Remarks

slotID

Code bit

NSString

Code bit ID

adSize

Ad size

CGSize

Ad size, the size set must be in the same proportion as the media platform configuration

Use BUNativeExpressBannerView to create an object, use BUNativeExpressBannerView to call loadAdData to request ads

复制

Optional parameters:

Field name

Field definition

Field type

Remarks

interval

Carousel interval

NSInteger

The carousel interval is between 30s and 120s, and the shortest carousel time is 2.5s

Remarks: This parameter needs to be set when the media platform selects the carousel function, and the time interval is between 30s and 120s

复制

Receive ads loading results

BUNativeExpressBannerViewDelegate

Callback Method

Notes

nativeExpressBannerAdView:didLoadFailWithError

The returned error code (error) indicates the reason why the ad failed to load. Please see the link for details of all error codes. Link

nativeExpressBannerAdViewRenderFail

Rendering failure, network or hardware reasons cause rendering failure, you can replace the mobile phone or network environment test. It is recommended to upgrade to the latest version of the CSJ platform

nativeExpressBannerAdViewDidLoad

Callback for successful ad loading

nativeExpressBannerAdViewRenderSuccess

Render success callback

BUNativeExpressBannerViewDelegate callback description

Callback Method

Notes

nativeExpressBannerAdViewDidLoad:bannerAdView

Callback for successful loading

nativeExpressBannerAdView: didLoadFailWithError:

The returned error code (error) indicates the reason why the ad failed to load. Please refer to the link for details of all error codes. Link

nativeExpressBannerAdViewRenderSuccess:

Rendering success callback

nativeExpressBannerAdViewRenderFail:error:

Rendering failed, the rendering failed due to network or hardware reasons, you can change the mobile phone or network environment to test. It is recommended to upgrade to the latest version of the CSJ platform

nativeExpressBannerAdViewWillBecomVisible:

This method is called when a new ad is displayed

nativeExpressBannerAdViewDidClick:

Click callback

nativeExpressBannerAdView:dislikeWithReason:

dislike callback method, you need to remove the advertisement in this callback method, and set the advertisement object to nil. If this callback method is not implemented, the close button will not take effect

nativeExpressBannerAdViewDidCloseOtherController: 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 open appstore/webpage/detail page, etc.

By setting BUNativeExpressBannerViewDelegate agent, get callbacks such as advertisement, display, click, and close. For other proxy methods, please refer to the section of BUDExpressBannerViewController class#pragma ---BUNativeExpressBannerViewDelegate in Demo

Display ads

Use addSubview to add ad objects to display ads. It is recommended that developers display Banner ads after receiving nativeExpressBannerAdViewRenderSuccess callbacks, to ensure smooth playback and smooth display, and a better user experience .

Display Banner Ads

复制

Timing

After receiving the nativeExpressBannerAdViewRenderSuccess callback, the advertisement is displayed, which can ensure smooth playback and smooth display, and a better user experience.

复制

Dislike callback description

复制

Precautions

  1. To avoid the situation of displaying ads first and then requesting data, banner ads are displayed by using addSubview to add ad objects to display ads
  2. When implementing the carousel function by yourself, it is recommended to keep the same as the platform carousel interval. The request interval is between 30s~120s to avoid the scenario of too frequent advertisement requests. The minimum rotation interval should not be less than 2.5s* *
  3. When the media platform selects the carousel function, the client can request and display advertisements, and the subsequent implementations are implemented internally by the SDK
  4. At present, the banner advertisement supports the display at the bottom or the top center of the content. Developers can adjust the left and right margins by themselves.

resource

For detailed access, please refer to the BUDExpressBannerViewController class in Demo, refer to the loadBannerWithSlotID method for the advertisement loading request part, and the showBanner method for the advertisement display part.


Contents
Contact us