Banner Ad
1. Basic requirements
Add ADX Unity SDK to your project.
Use the Ad Unit ID issued for Banner Ads.
Before requesting an ad, SDK initialization must be done first.
SDK initialization should be called only once when the app launches and ad requests should be made after SDK initialization is complete.
2. Implementation
If the app is distributed on both Android and iOS, enter the Ad Unit ID issued for each platform.
Instantiate
AdxBannerAdand register the required callbacks.Call
Load()to load the ad.
#if UNITY_ANDROID
string adxBannerAdUnitId = "<ANDROID_ADX_BANNER_AD_UNIT_ID>";
#elif UNITY_IOS
string adxBannerAdUnitId = "<IOS_ADX_BANNER_AD_UNIT_ID>";
#endif
void LoadBannerAd()
{
if (bannerAd != null)
{
bannerAd.Destroy();
bannerAd = null;
}
bannerAd = new AdxBannerAd(adxBannerAdUnitId, AdxBannerAd.AD_SIZE_320x50, AdxBannerAd.POSITION_TOP);
bannerAd.OnAdLoaded += BannerAd_OnAdLoaded;
bannerAd.OnAdFailedToLoad += BannerAd_OnAdFailedToLoad;
bannerAd.OnAdClicked += BannerAd_OnAdClicked;
bannerAd.Load();
}The following POSITION and AD_SIZE options are supported for banner ads.
3. Callback
You can receive specific events. Please implement them as needed.
4. Ad Revenue (OnPaidEvent)
You can check the estimated ad revenue for ad impressions.
Last updated
Was this helpful?