Banner Ads - StansAssets/com.stansassets.ultimate-mobile GitHub Wiki
This guide will provide you with samples of how to implement a banner ad.
You need to load the banner content before you can display it.
using SA.CrossPlatform.Advertisement;
...
//You can use any configured UM_AdPlatform here
//This example will use Unity ads, that's why we get client with UM_AdPlatform.Unity
UM_iAdsClient client = UM_AdvertisementService.GetClient(UM_AdPlatform.Unity);
client.Banner.Load((result) => {
if(result.IsSucceeded) {
Debug.Log("Banner ad loaded");
} else {
Debug.Log("Failed to load banner ads: " + result.Error.Message);
}
});
The load banner status can always be accessed via IsReady property.
bool ready = client.Banner.IsReady;
Once the banner is loaded, you can feel free to display it:
client.Banner.Show(() => {
Debug.Log("Banner Appeared");
});
You can also Hide the banner what you need.
client.Banner.Hide();
Or event Destroy. But you should understand that once the banner Destroyed you will need to Load banner content again.
m_adsClient.Banner.Destroy();