Splash
#
1、Load an ad- Developers can preload ads before displaying them.
- Create an advertisement object TPSplash, some advertisement platforms require acitivity to be passed in, otherwise the advertisement cannot be successfully loaded
- You don't need to pass in the container when loadingAd, you can pass in the container when displaying the ad
#
2、Show splash ad- During cold start, call loadAd as soon as possible, and display the ad immediately after listening to the onAdLoaded callback
- During hot start, the advertisement can be loaded in advance. When the event of switching the foreground of the device is detected, the isReady() method is called to check whether there is an available advertisement. When there is an available advertisement, the show method is called to display the advertisement.
- The developer needs to provide an ad container, and some of the three parties return it as a view; after listening to the onAdClosed callback, remove the container
#
3、Register Ad Event Callback- Note: Don't perform the retry loading method ad in
onAdFailed
callback – it'll cause a lot of useless requests and could make your app run slowly. - After listening to the onAdClosed callback, remove the container adContainer
#
4、Code- We recommend that you use the SplashActivity to understand the use of the SDK.