Banner
If you want to use an adaptive banner, make sure to check the option in the asset settings.

Create a request to load the ad.
You should call this part of the code once at the beginning.
using UnityEngine;
using AdManagerPro;
public class Test : MonoBehaviour {
private void Start()
{
// Requests to download advertisements
BannerAdManager.RequestAdBanner();
}
}
IMPORTANT! By default, the banner position is set to the bottom.To change the banner position, you need to add AdPosition
to the request and select the desired position.
BannerAdManager.RequestAdBanner(AdPosition.Top);
SHOW, HIDE, or DESTROY
You can SHOW, HIDE, or DESTROY the banner using the following code snippets:
Show Banner:
BannerAdManager.ShowAdBanner();
Hide Banner:
BannerAdManager.HideAdBanner();
Destroy Banner:
BannerAdManager.DestroyAdBanner();
If you need to check the availability/loading status of the ad, include the following code snippet:
using UnityEngine;
using AdManagerPro;
public class Test : MonoBehaviour
{
private void Start()
{
if(BannerAdManager.isAdmobBannerReady){
Debug.Log("The ad is available.");
}
}
}
Last updated