Template rendering information flow: The scene should be displayed interspersed with the application content in the application content stream, and the advertising content should be distinguished from other content in the application to prevent accidental clicks.
Supported ad sizes: Developers can select multiple templates and multiple sizes on the CSJ platform. Template rendering information flow ads support developers to adjust and edit
**Template rendering information flow advertisement: ** Provided by default
The template information flow advertisement uses the BUNativeExpressAdManager object to call loadAd to request the advertisement, and uses the BUNativeExpressAdView object to render the advertisement. By setting the BUNativeExpressAdViewDelegate agent, it obtains callbacks such as advertisement, display, click, and close.
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
Field name | Field definition | Field type | Remarks |
BUAdSlot | / | / | Basic information configuration, see case for details |
adSize | Ad size | CGSize | Ad size, width can be set to screen width, height can be directly set to 0 when adaptive |
Before requesting ads, you need to configure the basic information of BUAdSlot ads, use BUNativeExpressAdManager to create objects, and use BUNativeExpressAdManager to call loadAd to request ads
Note:
- self.nativeExpressAdManager can be reused
- AdSize of the size of the template information flow is recommended width is set to screen width, height is set to 0 or the height of the platform checked Do not set the size at will, otherwise it may fail to pull or the advertisement may be deformed
- Template information flow ads can be requested for multiple ads at the same time, maximum number of requests is 3
- The default setting of the template information flow advertisement imgSize is BUProposalSize_Feed228_150
Callback Method | Notes |
The error code returned by | nativeExpressAdFailToLoad |
nativeExpressAdViewRenderFail | 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 |
nativeExpressAdSuccessToLoad | Ad view loaded successfully |
nativeExpressAdViewRenderSuccess | Rendering success |
By setting the BUNativeExpressAdViewDelegate agent, you can get callbacks such as ads, display, click, and close. For other proxy methods, please refer to the section of BUDExpressFeedViewController class#pragma mark-BUNativeExpressAdViewDelegate in Demo
Since the official Demo uses tableView for the insertion and display of advertisements, you can update the relevant insertion display of the advertisement by directly updating the data source. It is recommended that the developer perform the rendering and display of the advertisement after receiving the nativeExpressAdSuccessToLoad callback to ensure smooth playback and smooth display. , The user experience is better. Therefore, if you do not use this method for the display of information flow advertisements, remember not to forget addSubview to add advertising objects to display the advertisements.
After receiving the nativeExpressAdSuccessToLoad callback, the advertisement will be rendered and displayed, and the data source will be refreshed.
Note: In order to avoid excessive memory from triggering the system optimization mechanism, it is recommended to perform the removal operation of remove
at the appropriate time. Currently the SDK is implemented using WKWebView. This recommendation is not limited to template information flow ads, other ads are also applicable , To ensure that unused advertisements will be released at the right time
Note:
- Remember not to forget to set the rootViewController of the BUNativeExpressAdView object, ensure that the currently passed in rootViewController is not empty, and make sure that self.nativeExpressAdManager has made reuse judgment, otherwise there may be occasional dislike callback method failure Anomalous scene
rootViewController is not empty
For detailed access, please refer to the BUDExpressFeedViewController class in Demo, refer to the loadData method for the ad loading request part, and the nativeExpressAdSuccessToLoad method for the ad display rendering part.
Online Customer Service24/7 Online Customer Service BotManual customer service, weekdays 10~ 12 o'clock/14~ 19 o'clock