NativeBanner Ads
#
1. Request AdsParameter Description
#
unitId: Ad Unit ID created on TradPlus backend- Developers need to fill it correctly. For example, adding or removing spaces before and after the unitId will result in a failed request due to missing configurations.
#
sceneId: Ad Scene ID- Developers can create it on the TradPlus backend, located at: App Management - Ad Scenes.
- When entering the ad scene, pass in the sceneId, and when displaying the ad, the sceneId should also be passed in. Otherwise, it will affect the statistics.
#
TPNativeBannerExtra: 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 (effective only when both x and y are 0), default is TopLeft.
- closeAutoShow: Whether to close automatic display. Automatic display is enabled by default, pass in true to disable it.
- customMap: Set Segement related attribute parameters
- localParams: Set local parameters. Only supported on Android. Parameters that need to be set for specific ad platforms.
- className: The name of the native banner rendering template, which can be left unset. The SDK will use the default template for rendering.
#
2. Check for Available Ads- It is recommended that developers call this API to check if ads are available before displaying them. Call the show method only if there are ads available.
- true means there are ads available, false means there are currently no ads available.
#
3. Enter Ad Scene (Optional)#
4. Display AdsThis interface is used in conjunction with closeAutoShow to disable automatic display.
#
5. Hide Displayed Ads#
6. Display Hidden Ads#
7. Destroy Ads#
8. Listen for CallbacksParameter Description
adInfo: Ad Unit ID, third-party ad platform, eCPM, and other information. Please refer to Android Callback Information and iOS Callback Information for details.
error: Error information for a failed ad request or ad display. Please refer to Error Code and Error Message for details.