Skip to main content

Banner

Step 1.Prerequisites#

This document mainly introduces how to integrate Banner 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 Unity3DAndroid

Step 2.Integration#

...
//Create adUnitId from your App
TradPlus.LoadBannerPluginsForAdUnits("AdUnitId");
//Load an Ad and set up ads to pop up
TradPlus.CreateBanner("AdUnitId",TradPlus.AdPosition.BottomCenter);
//Set an Scenario Id
TradPlus.BannerEntryAdScenario("AdUnitId");
//You can hide or show an ad using setVisibility when an ad is Loaded
TradPlus.ShowBanner("AdUnitId",true);
//You can show an ad After hide ad
TradPlus.ShowBanner("AdUnitId",false);
//Close ad
TradPlus.DestroyBanner("AdUnitId");
...
// Called when the ad for the given adUnitId has loaded.
TradPlusManager.OnAdLoadedEvent += OnAdLoadedEvent;
// Called when the ad fails to load for the given adUnitId.
TradPlusManager.OnAdFailedEvent += OnAdFailedEvent;
// Called when a banner ad is clicked.
TradPlusManager.OnAdClickedEvent += OnAdClickedEvent;
// Called when a banner ad starts playing.
TradPlusManager.OnAdExpandedEvent += OnAdExpandedEvent;
...