Banners
#
Precautions- Do not execute the ad loading method in the
onAdLoadFailed
callback, otherwise it will cause an infinite loop. - Developers can refer to the banner.dart integration in the Demo
#
Integration steps#
1、Request AdsParameter Description
#
unitId:The unitId created in the TradPlus backend- Developers must fill in the information correctly. For example, if there are spaces before and after the unitId setting, the ad request will fail because the configuration cannot be pulled.
#
extraMap:Additional parameters- width Width of the banner container
- height Height of the banner container
- customMap:Set Traffic Grouping Related attribute parameters
- localParams:Set local parameters. Parameters that need to be set for individual advertising platforms.
- sceneId :ad scene ID
- Developers can create it in the TradPlus backend at the following location: Application Management - ad Scene.
- For details on how to call, please refer to Description of the timing and purpose of calling advertising scenes。
- When entering the advertising scene, pass in the sceneId. When displaying the advertisement, you also need to pass in the sceneId, otherwise it will affect the statistics.
#
2、Check if ads are available- Developers call this method after listening to the onAdLoaded callback.
- It is recommended that developers call this API to determine whether there are available ads before displaying ads, and then call the show method if there are ads.
- true means there are available ads, false means there are no available ads for the time being
#
3、Enter the Ad scene#
4、Display adsFlutter plugin version v1.0.4+, iOS v8.5.0+, Android v8.8.0.1+
Banner ads support mixed use of native ads. Developers can pass in a custom native template name through the optional parameter className.
#
5、Listening callbackParameter Description
- adInfo:For more information, please refer to Callback Information Description。
- error:Error messages about ad request failure and ad display failure. For details, please refer to Error code and error message description