Homa Belly does support the following Ad formats:
- Rewarded video ads
- Banners
- Interstitials
Banners
Showing a Banner
In order to show a banner, register the onBannerAdLoadedEvent and call LoadBanner
Once the banner is loaded, onBannerAdLoadedEvent will be invoked, so you are ready to show it
Hiding a Banner
Whenever you want to hide the currently displayed banner, call HideBanner
Showing two banners at the same time
It is possible to show two banners at the same time.
Make sure to obtain a secondary banner ad unit id and to not place the second banner in the same `BannerPosition` than the default one.
Here's a sample code snippet you can use as inspiration:
Making UI work with a banner
To get the size of the displayed banner in pixel, you can call
⚠️ Like all methods in this page, you must wait for Homa Belly initialization before calling it.
You can also make use of the BannerSafeAreaHelper component. If you apply it on your canvas game object, it will take its “SafeArea” child and resize it to make sure its content is not blocked by banners.
When you add it to your canvas object, it should look like this:
You can use the editor tool to create a “SafeArea” child and automatically move the current canvas children into the safe area.
You then need to specify the position and the background color of the banner you will use and you are all set:
An AdInfo holds :
- A PlacementId : the “ad unit”, “placement id”, or identifier used by the mediator
- An AdType : the type of ad (usually Banner, Interstitial or Rewarded)
- An AdPlacementType : tells you where this ad placement is coming from