Banners
#
1. Request AdParameter Description
#
unitId: Ad unit ID created on TradPlus backend- Developers need to fill in correctly, for example: if there are spaces before and after unitId, it will cause the advertising request to fail due to failure to pull configuration.
#
sceneId: Ad scene ID- Developers can create it in TradPlus backend, located as follows: App Management-Ad Scene.
- Enter sceneId when entering the ad scene, and also need to pass sceneId when displaying the ad, otherwise it will affect statistics.
#
TPBannerExtra: Additional parameters- x: Coordinate x, default is 0.
- y: Coordinate y, default is 0.
- width: Width, default is 320.
- height: Height, default is 50.
- adPosition: Screen position positioning (effective when both x and y are 0), default TopLeft.
- closeAutoShow: Whether to close automatic display. Automatic display is enabled by default, and true is passed to turn off.
- customMap: Set Segement related attribute parameters
- localParams: Set local parameters. Android only. Some advertising platforms require special parameters to be set.
- className: Set the native banner using a custom rendering method. Developers can pass in the layout name. Android only, added in V8.7.0.1 API
(1) From Android V8.7.0.1, native banner types can be configured using banner ad unit settings, and the SDK has built-in default layout styles. If developers need to define their own layout styles, they need to use this method for rendering.
(2) For more information, see the section "How to Use Banner Ad Units to Configure Native Banners" below.
(3) tp_native_banner_ad_unit is the style layout file provided by TradPlus and can be obtained in the downloaded Unity package.
#
2. Check for Available Ads- It is recommended that developers call this API to determine if there is an available ad before showing the ad. The show method is called only when there is an ad available.
- true means there is an available ad, false means there is no available ad temporarily.
#
3. Enter the ad scene (optional)#
4. Display AdsThis interface is used in conjunction with closeAutoShow to turn off automatic display
#
5. Hide Displayed Ads#
6. Display Hidden Ads#
7. Destroy Ads#
8. Listen for callbacksParameter Description
adInfo: Advertisement placement ID, third-party advertising platform, eCPM, and other information. Please refer to Android Callback Information Description and iOS Callback Information Description for details.
error: Error information for failed ad requests and ad display failures. Please refer to Error Code and Error Information Description for details.
#
Common Callbacks#
Ad Source Dimension Callback Listening (optional)#
9. How to Use Native Banner Ad with Banner Ad Placement Configuration- Supported starting from TradPlus SDK v8.7.0.1. Developers need to add new ad sources under the banner ad placement and select "Native Banner" as the banner type.
#
Backend Configuration- Step 1: Select TradPlus Banner Ad Placement Type in the backend (Note: Choosing the wrong placement type will not have the Banner Type option).
- Step 2: Click "Edit" and select "Native Banner" as the banner type in the Banner Type.
- Step 3: Configure the third-party advertising network's Placement ID.
#
Custom Rendering of Native Banner Ads- If developers do not use the SDK's built-in layout style, they can customize the style for rendering native banner ads.