Home


Banner Ads

Banner is a rectangle filled with an advertising content, displayed on the screen without interrupting the flow of your app.

-- Toggle the banner ad

if isBannerVisible then
    enhance.hideBannerAd()
    isBannerVisible = false

elseif enhance.isBannerAdReady() then
    enhance.showBannerAdWithPosition("top")
    isBannerVisible = true
end

Methods

enhance.isBannerAdReady

boolean enhance.isBannerAdReady(
    optional string placement = "default"
)

Check if an ad from any of the included SDK providers is ready to be shown.

Parameters:

optional string  placement - Specifies the internal placement of the ad (from the Enhance mediation editor).

Return Value:

Returns true if any ad is ready, false otherwise. When app is not Enhanced, always returns true.

enhance.showBannerAdWithPosition

nil enhance.showBannerAdWithPosition(
    optional string placement = "default",
    optional string position = "bottom"
)

Display an ad if any is currently available. The ad provider is selected based on your app's mediation settings.

Parameters:

optional string  placement - Specifies the internal placement of the ad (from the Enhance mediation editor).

optional string  position - Specifies the position of this ad on the screen. Use either "top" or "bottom".

enhance.hideBannerAd

void enhance.hideBannerAd()

Hide the banner ad which is currently visible, if any.