Template rendering Banner: Developers do not need to edit and render the ad style by themselves, but can directly call the relevant interface for ad display.
Note: Developers are not supported to add buttons to the view and block ads
**Template rendering Banner ads: ** Provided by default
Note:
- The template advertisement request method requires the developer to set the setExpressViewAcceptedSize parameter in dp.
- In the parameter setting of the desired personalized template size, the personalized template Banner ad height cannot be set to 0
- For the setExpressViewAcceptedSize parameter, please make a request according to the proportion checked by the platform. The platform now supports 8 sizes. If the requested ratio is inconsistent with the size selected when the platform creates the code bit ID, a badcase of the display effect will appear. Therefore, the request ratio should be consistent with the platform ticked
Parameter | Description |
setCodeId | The code ID created by the platform starts with 9 and 9 digits |
setAdCount | The number of requests is 1-3. It is recommended to set to 1 |
setExpressViewAcceptedSize | Set the size of the request template creative unit: dp |
loadBannerExpressAd(AdSlot adSlot, @NonNull NativeExpressAdListener listener)
Load ads asynchronously
Note:
-When creating the code bit, you need to choose whether to support carousel
- If you choose carousel, you need to call
TTNativeExpressAd.setSlideIntervalTime(30 * 1000);
in the onNativeExpressAdLoad callback to set the carousel time
Set the interval of banner advertisement rotation. If not set, the rotation will not be turned on by default. Banner advertisement rotation interval, the allowable value is between30 * 1000 ~ 120 *1000
Callback | Description |
onError() | Advertisement request failed callback The returned error code (code) indicates the reason for the failure of the advertisement request.,详情请见链接 |
onNativeExpressAdLoad() | Callback for successful ad request, the client can call |
Callback | Description |
onAdDismiss() | Ad close callback |
onAdClicked() | Callback when the ad is clicked |
onAdShow() | Ad show callback |
onRenderFail() | Ad rendering failed callback |
onRenderSuccess() | The personalized template is rendered successfully, and the client can add the advertisement directly to the control in the callback |
Note: Before addView, you need to call the removeAllViews method to remove all the views on the control
The dislike logic helps us to improve the advertising experience and match, please follow the access instructions to set
The following logic is the logic in the CSJ version 3500 SDK. SDK developers below 3500 version can refer to the corresponding demo for integration
Callback | Description |
onItemClick() | Callback when the user clicks on filterWord in the case of a custom style |
onClick() | In the case of custom styles, the user clicked "Why see this ad" |
onSelected() | The default dislike style, click filterWord to call back. The developer can remove the ad in this callback |
onCancel() | Default dislike style, click to cancel callback |
onShow() | Default dislike style, dislike pop-up window shows back |
onRefuse() | The default dislike style, the user repeatedly clicks the dislike button to call back. Version 3600 is abolished |
For template rendering of Banner ads, please refer to the BannerExpressActivity
example in Demo
Online Customer Service24/7 Online Customer Service BotManual customer service, weekdays 10~ 12 o'clock/14~ 19 o'clock