OfferWalls
#
Precautions- Do not execute the ad loading method in the
onAdLoadFailed
callback, otherwise it will cause an infinite loop.。 - Do not directly execute the ad display method in the
onAdLoaded
callback. The SDK has an automatic ad refill function. IfshowOfferwallAd ()
is executed in theonAdLoaded
callback, the developer will not be able to accurately control the timing of ad display. - Developers can refer to the offerwall.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- customMap:Set Traffic Grouping Related attribute parameters
- localParams:Set local parameters. Parameters that need to be set for individual advertising platforms.
#
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
- When calling
offerwallAdReady
and returns false, the sdk will request ads again, and the developer does not need to call the load method again.
#
3、Display ads#
4、Other APIThese APIs return result information through corresponding callbacks
- Set UserId It is set when the user switches accounts. UserId is bound to the subsequent points API and is set after the first successful load.
- Get the current user's points balance
- Consumption points Use when exchanging points for items
- Apply active reward points
#
5、Listening callback参数说明
- 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