Integrate with Enhance - Xamarin
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) { Enhance.HideBannerAd(); isBannerVisible = false; } else if (Enhance.IsBannerAdReady()) { // The ad is ready, show it Enhance.ShowBannerAdWithPosition(Enhance.Position.Top); isBannerVisible = true; }
Methods
Enhance.IsBannerAdReady
bool 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
void Enhance.ShowBannerAdWithPosition(
optional string placement = "default",
Enhance.Position position
)
Parameters:
optional string placement
- Specifies the internal placement of the ad (from the Enhance mediation editor).
Enhance.Position position
- Specifies the position of this ad on the screen. See the Properties section for the values you can use.
Enhance.HideBannerAd
void Enhance.HideBannerAd()
Properties
string Enhance.DEFAULT_PLACEMENT
The default internal placement of all ad types. Always equal to "default"
.
Enhance.Position.Top
Indicates that the banner will be shown on the top of the screen.
Enhance.Position.Bottom
Indicates that the banner will be shown on the bottom of the screen.