Native Ads
#
1. Request AdParameter Description
#
unitId: Ad unit ID created on the TradPlus platform.- The developer needs to fill in correctly, for example, if there are spaces before and after the unitId setting, it will cause the ad to fail to request due to failure to retrieve the configuration.
#
TPNativeExtra: Extra Parameters- x: Coordinate x, default 0.
- y: Coordinate y, default 0.
- width: Width, default 320.
- height: Height, default 200.
- adPosition: Screen position positioning (effective when x and y are both 0), default TopLeft.
- customMap: Set Segement related attribute parameters
- localParams: Set local parameters. Only for Android. Some ad platforms require special parameters to be set.
#
2. Check for Available Ads- It is recommended that developers call this API to determine whether there are available ads before displaying the ad. Only when there are ads, call the show method.
- True means there is an available ad, and false means there are no ads available temporarily.
#
3. Enter Ad Scene (Optional)Parameter Description
#
sceneId: Ad Scene ID- Developers can create an ad scene in TradPlus backend. The location is as follows: Application Management - Advertising Scenes.
- When entering the advertising scene, pass in the sceneId. The sceneId must also be passed in when displaying the ad, otherwise it will affect statistics.
#
4. Display AdsParameter Description
#
className: Template Name- Developers can set the standard native rendering template through this parameter, and the plugin default template will be used for rendering by default.
- The iOS default template is located in the Assets/Plugins/IOS directory (TPNativeTemplate.h, TPNativeTemplate.m, TPNativeTemplate.xib)
- The Android default template has been included in the Tradplus plugin, and developers do not need to reference it again.
#
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 Callback Information for Android and Callback Information for iOS.
error: Error information for ad request failure or ad display failure. Please refer to Error Code and Error Information Description.