Integrate with Enhance - Cordova
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 banner ad if(isBannerAdVisible) { isBannerAdVisible = false; Enhance.hideBannerAd(); } var callback = function(result) { if(!result) { app.writeLog('Banner ad is not ready'); return; } isBannerAdVisible = true; Enhance.showBannerAdWithPosition(Enhance.Position.BOTTOM); }; Enhance.isBannerAdReady(callback);
Methods
Enhance.isBannerAdReady
void Enhance.isBannerAdReady(
Function resultCallback,
optional String placement = "default"
)
Parameters:
Function resultCallback
- Specifices the callback function.
optional String placement
- Specifies the internal placement of the ad (from the Enhance mediation editor).
Return Value:
Returns true
to the callback function if any ad is ready, false
otherwise. When app is not Enhanced, always returns true
.
Enhance.showBannerAdWithPosition
void Enhance.showBannerAdWithPosition(
String position,
optional String placement = "default"
)
Parameters:
String position
- Specifies the position of this ad on the screen. See the Properties section for the values you can use.
optional String placement
- Specifies the internal placement of the ad (from the Enhance mediation editor).
Enhance.hideBannerAd
void Enhance.hideBannerAd()
Properties
String Enhance.Position.TOP
Indicates that the banner will be shown on the top of the screen.
String Enhance.Position.BOTTOM
Indicates that the banner will be shown on the bottom of the screen.