Interstitial
#
Step 1.PrerequisitesThis document mainly introduces how to integrate Interstitial Ads :
- Use Android Studio 3.2 or later
- minSdkVersion 16 or later
- compileSdkVersion 28 or later
- Recommended: Create your TradPlus Apps and get your AppId
- Initialize the TradPlus SDK for Android
#
Step 2.Integration#
1.Create and Cache the Interstitial Ad#
(1)V6.X New API#
(2)V5.X Old API- Using auto-loading mode, you can initialize the UnitId directly
- Don't use auto-loading mode
- AutoLoad Mode Integration
- After Add Unit ,you can get
adUnitId
, as shown below:
#
2.Implement Event Listeners#
(1)V6.X New API#
(2)V5.X Old API#
3.Load an Ad#
(1)V6.X New API#
(2)V5.X Old API#
4.Set the SceneId#
(1)V6.X New API#
(2)V5.X Old APIYou can create SceneId , as shown below :
You can get SceneId , as shown below :
#
5.Show an AdIf you choose to call SceneId when entering the interface where the ad slot is located, you must pass it while showing the ad, otherwise you only need to pass in the AdUnitId as a parameter
#
(1)V6.X New API#
(2)V5.X Old API#
6. Check is ReadyBefore show an Ad , using the isReady()
method to make sure you have available ads.
#
(1)V6.X New API#
(2)V5.X Old API#
7.Other APITPAdInfo is the information object of the ad,mainly including the id information of the third-party network platform.
Method | Description |
---|---|
tpAdInfo.isoCode | Iso Code |
tpAdInfo.adSourceName | Third-party network name |
tpAdInfo.adSourceId | Third-party network placement |
tpAdInfo.loadTime | Loading time |
tpAdInfo.ecpm | Get ecpm |
tpAdInfo.adUnitId | TradPlus adUnitId |