Loading a Banner
To load a banner, call CreateBanner()
, passing it your Ad Unit ID and desired banner position:
-
const FString BannerAdUnitId = TEXT("banner_ad_unit_ID"); void InitializeBannerAds() { // Banners are automatically sized to 320×50 on phones and 728×90 on tablets // You may call the utility method UAppLovinMAX::IsTablet() to help with view sizing adjustments UAppLovinMAX::CreateBanner(BannerAdUnitId, EAdViewPosition::BottomCenter); // Set background or background color for banners to be fully functional UAppLovinMAX::SetBannerBackgroundColor(BannerAdUnitId, banner_background_color); }
The above example creates a banner at the bottom-center of the display (BottomCenter
). The complete list of position options are:
TopLeft
TopCenter
TopRight
Centered
CenterLeft
CenterRight
BottomLeft
BottomCenter
BottomRight
Set your banner background color to any FColor
, for example FColor:Black
or FColor:FromHex("#fff200")
(yellow).
Showing a Banner
To show a banner, call ShowBanner()
:
-
UAppLovinMAX::ShowBanner(ad_unit_ID);
Hiding a Banner
To hide a banner, call HideBanner()
:
-
UAppLovinMAX::HideBanner(ad_unit_ID);