Help Center/Details/

Self-rendering Banner Ads

Introduction

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

Supported ad sizes:

  • Large picture (Picture with aspect ratio: 1.78)
  • Small image (Picture with aspect ratio: 1.52)
  • Group pictures (three pictures with aspect ratio: 1.52)

Permission:

Self-rendering Banner Ads: Reclaimed and no longer available for creation

  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

Instructions for use

Self-rendering Bannar ads use the BUNativeAd object to call loadAdData to request the ad, and set the BUNativeAdDelegate agent to get the ad-related materials and click callbacks.

Create an ad slot object and request an ad

BUNativeAd

When requesting an advertisement, the advertisement slot object must be passed in. When the advertisement slot object is created, the advertisement slot ID and the basic configuration of the advertisement must be passed in BUAdSlot, BUSize

Required parameters:

Field Definition Field Name Field Type Remarks
BUAdSlot / / Basic configuration
BUSize / /Request the size of the ad image, in px
slotID Code bit NSString Code bit ID

Use BUAdSlot, BUSize to create basic advertising information, and use BUNativeAd to call loadAdData to request ads

 if (!self.nativeAd_load) {
   BUSize *imgSize1 = [[BUSize alloc] init];
   imgSize1.width = 1080;
   imgSize1.height = 1920;
        
   BUAdSlot *slot1 = [[BUAdSlot alloc] init];
   slot1.ID = self.viewModel.slotID;
   slot1.AdType = BUAdSlotAdTypeBanner;
   slot1.position = BUAdSlotPositionTop;
   slot1.imgSize = imgSize1;
   slot1.isOriginAd = YES;
        
   BUNativeAd *nad = [[BUNativeAd alloc] initWithSlot:slot1];
   nad.rootViewController = self;
   nad.delegate = self;
   self.nativeAd_load = nad;
}
   [self.nativeAd_load loadAdData];

Receive ads loading results

BUNativeAdDelegate

Callback Method Notes
nativeAd: didFailWithError: 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
nativeAdDidLoad: Ad loading success callback It is recommended to insert data in this callback method

BUNativeAdDelegate callback description

Callback Method Notes
nativeAdDidLoad: Callback for successful loading of advertising materials nativeAd: didFailWithError: The returned error code (error) indicates the reason for the failure to load the ad. Please refer to the link for details of all error codes. Link
nativeAdDidBecomeVisible: Ad display callback
nativeAdDidCloseOtherController: 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
nativeAdDidClick:withView: Click callback method
nativeAd: dislikeWithReason: dislike button click callback

By setting BUNativeAdDelegate agent, get callbacks such as advertisement closing. For other proxy methods, please refer to the BUDNativeBannerViewController class in Demo

Display self-rendered Bannar ads

-(void)nativeAdDidLoad:(BUNativeAd *)nativeAd {
    if (!nativeAd.data) {return;}
    if (!(nativeAd == self.nativeAd_load)) {return;}
//Related assignment operations can be performed in this callback method
}

Click the dislike close button example

-(void)nativeAd:(BUNativeAd *)nativeAd dislikeWithReason:(NSArray<BUDislikeWords *> *)filterWords {
//Relevant data refresh is required in this callback, otherwise clicking close will not take effect
}

resource

The detailed docking method can refer to the BUDNativeBannerViewController class in demo for corresponding docking processing

Did the content solve your problem?
Contact us