Help Center/Details/

Template rendering interstitial

Introduction

Template rendering interstitial: Use the scene to experience the interruption of the application function naturally, such as pausing the video playback, between game levels. Interstitial ads should not appear suddenly, and should not interfere with the normal process of users using the app, such as app loading, exiting the app, or during the game.

Supported ad sizes: 1:1, 2:3, 3:2 three sizes
Note: ⚠️⚠️⚠️ Request a template interstitial ad, the height value cannot be set to 0⚠️⚠️⚠️

Permission

Template rendering interstitial: Provided by default

To avoid distortion of the ad view during the rendering process, the requested size of the interstitial ad must be the same size as the media platform configuration

Template Interstitial Ads

Instructions for use

The template interstitial uses the BUNativeExpressInterstitialAd object to call loadAdData to request the advertisement, and the BUNativeExpressInterstitialAd object to call showAdFromRootViewController: to display the advertisement. By setting the BUNativeExpresInterstitialAdDelegate agent, get the advertisement, display, Click, close and other callbacks.

Create an ad slot object and request an ad

BUNativeExpressInterstitialAd

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 Definition Field Name Field Type Remarks
slotID Code bit NSString Code bit ID
adSize Ad size CGSize Ad size, must be the same size as the media platform configuration

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

self.interstitialAd = [[BUNativeExpressInterstitialAd alloc] initWithSlotID:slotID adSize:CGSizeMake(width, height)];
self.interstitialAd.delegate = self;
[self.interstitialAd loadAdData];

Receive ads loading results

BUNativeExpresInterstitialAdDelegate

Callback Method Notes
nativeExpresInterstitialAd: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
nativeExpresInterstitialAdRenderFail 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
nativeExpresInterstitialAdDidLoad Creative material loaded successfully
nativeExpresInterstitialAdRenderSuccess Render success

BUNativeExpresInterstitialAdDelegate callback description

Callback Method Notes
nativeExpresInterstitialAdDidLoad: Ad material loaded successfully
nativeExpresInterstitialAd: 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. Linkhttps://ad.oceanengine.com/union/media/doc?id=5de4cc6d78c8690012a90aa5)
nativeExpresInterstitialAdRenderSuccess: Render success callback
nativeExpresInterstitialAdRenderFail: 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
nativeExpresInterstitialAdWillVisible: The template interstitial ad will be displayed soon
nativeExpresInterstitialAdDidClick: Click callback
nativeExpresInterstitialAdWillClose: Ad is about to close callback
nativeExpresInterstitialAdDidClose: Close callback
nativeExpresInterstitialAdDidCloseOtherController: 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 the BUNativeExpresInterstitialAdDelegate agent, you can get callbacks such as ads, display, click, and close. For other proxy methods, please refer to the section of BUDExpressInterstitialViewController class #pragma ---BUNativeExpresInterstitialAdDelegate in demo

Display ads

Call the showAdFromRootViewController: method to display the interstitial ad, where the currently displayed page needs to be passed in. Be sure to set rootViewController, which is the viewController needed to display ads and jump landing pages. It is recommended that developers display interstitial ads after receiving the nativeExpresInterstitialAdRenderSuccess callback to ensure smooth and smooth playback. The presentation is smooth and the user experience is better.

Show interstitial video ads

if (self.interstitialAd) {
   [self.interstitialAd showAdFromRootViewController:self];
}

Timing

Display the advertisement after receiving the nativeExpresInterstitialAdRenderSuccess callback, which can ensure smooth playback and smooth display, and a better user experience.

-(void)nativeExpresInterstitialAdRenderSuccess:(BUNativeExpressInterstitialAd *)interstitialAd {
 //Ads are displayed in this callback method to ensure smooth playback and smooth display, and a better user experience.
}

Precautions

  1. rootViewController must be set to handle ad jumps. All jumps in the SDK adopt the method of present. Please ensure that the rootViewController passed in cannot be empty and no other controllers are presented, otherwise the presentedViewController will already exist and the presentation will fail.
  2. In order to ensure smooth playback and smooth display, and a better user experience, the advertisement will be displayed after receiving the nativeExpresInterstitialAdRenderSuccess callback
  3. To judge whether the advertisement is effective, just use self.interstitialAd to judge

resource

For detailed access, please refer to the BUDExpressInterstitialViewController class in Demo. For the advertisement loading request part, please refer to the loadInterstitialWithSlotID method, and for the advertisement display part, please refer to the showInterstitial method.

Did the content solve your problem?
Contact us