Integrate with Enhance - Defold
Banner Ads
Banner is a rectangle filled with an advertising content, displayed on the screen without interrupting the flow of your app.
Example Usage
-- 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"
)
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"
)
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"
.