Banner Ads



Banner Ads: Unity (C#)




Banner Ads are small sized ads displayed on the screen as a rectangle filled with content without interrupting the flow of the 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

bool Enhance.IsBannerAdReady( string placement = Enhance.PLACEMENT_DEFAULT )

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

Parameters:
optional string placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Returns:
Returns true if any ad is ready, false otherwise.

void Enhance.ShowBannerAdWithPosition( string placement = Enhance.PLACEMENT_DEFAULT, Enhance.Position position )

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

Parameters:
optional stringplacement - Specifies the placement of the ad (describes in what moment the ad is shown).

Enhance.Positionposition - Specifies the position of the ad on the screen.

void Enhance.HideBannerAd()

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

Members

string Enhance.PLACEMENT_DEFAULT

The default placement of ads, including banner ads.

enum Enhance.Position.TOP

The top of the screen, use to set banner ads position.

enum Enhance.Position.BOTTOM

The bottom of the screen, use to set banner ads position.

Banner Ads: Android (Java)




Banner Ads are small sized ads displayed on the screen as a rectangle filled with content without interrupting the flow of the 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

bool Enhance.isBannerAdReady()

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

Returns:
Returns true if any ad is ready, false otherwise.

bool Enhance.isBannerAdReady( String placement )

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

Parameters:
String placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Returns:
Returns true if any ad is ready, false otherwise.

void Enhance.showBannerAdWithPosition( Enhance.Position position )

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

Parameters:
Enhance.Positionposition - Specifies the position of the ad on the screen.

void Enhance.showBannerAdWithPosition( String placement, Enhance.Position position )

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

Parameters:
String placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Enhance.Positionposition - Specifies the position of the ad on the screen.

void Enhance.hideBannerAd()

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

Members

String Enhance.PLACEMENT_DEFAULT

The default placement of ads, including banner ads.

enum Enhance.Position.TOP

The top of the screen, use to set banner ads position.

enum Enhance.Position.BOTTOM

The bottom of the screen, use to set banner ads position.

Banner Ads: iOS (Objective-C)




Banner Ads are small sized ads displayed on the screen as a rectangle filled with content without interrupting the flow of the app.

Example Usage

// Toggle the banner ad

if (isBannerAdShown) {
    [Enhance hideBannerAd];
    isBannerAdShown = false;
}

else {
    bool isBannerAdReady = [Enhance isBannerAdReady];

    if(isBannerAdReady) {
        [Enhance showBannerAdWithPosition:POSITION_BOTTOM];
        isBannerAdShown = true;
    }
}

Methods

BOOL [Enhance isBannerAdReady]

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

Returns:
Returns YES if any ad is ready, NO otherwise.

BOOL [Enhance isBannerAdReady: (NSString*)placement ]

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

Parameters:
NSString* placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Returns:
Returns YES if any ad is ready, NO otherwise.

void [Enhance showBannerAdWithPosition: (Position)position ]

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

Parameters:
Positionposition - Specifies the position of the ad on the screen.

void [Enhance showBannerAdWithPosition: (NSString*)placement position:(Position)position ]

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

Parameters:
NSString* placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Positionposition - Specifies the position of the ad on the screen.

void [Enhance hideBannerAd]

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

Members

NSString* PLACEMENT_DEFAULT

The default placement of ads, including banner ads.

enum POSITION_TOP

The top of the screen, use to set banner ads position.

enum POSITION_BOTTOM

The bottom of the screen, use to set banner ads position.

Banner Ads: OpenFL (Haxe)




Banner Ads are small sized ads displayed on the screen as a rectangle filled with content without interrupting the flow of the 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( ?placement:String = Enhance.PLACEMENT_DEFAULT ):Bool

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

Parameters:
optional String placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Returns:
Returns true if any ad is ready, false otherwise.

Enhance.showBannerAdWithPosition( ?placement:String = Enhance.PLACEMENT_DEFAULT, ?position:Int = Enhance.POSITION_BOTTOM ):Void

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

Parameters:
optional String placement - Specifies the placement of the ad (describes in what moment the ad is shown).

optional Int position - Specifies the position of the ad on the screen.

Enhance.hideBannerAd():Void

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

Members

Enhance.PLACEMENT_DEFAULT:String

The default placement of ads, including banner ads.

Enhance.POSITION_TOP:Int

The top of the screen, use to set banner ads position.

Enhance.POSITION_BOTTOM:Int

The bottom of the screen, use to set banner ads position.

Banner Ads: Adobe Air (AS3)




Banner Ads are small sized ads displayed on the screen as a rectangle filled with content without interrupting the flow of the 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( placement:String = Enhance.PLACEMENT_DEFAULT ):Boolean

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

Parameters:
optional String placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Returns:
Returns true if any ad is ready, false otherwise.

Enhance.showBannerAdWithPosition( position:String = Enhance.POSITION_BOTTOM, placement:String = Enhance.PLACEMENT_DEFAULT ):void

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

Parameters:
optional String position - Specifies the position of the ad on the screen.

optional String placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Enhance.hideBannerAd():void

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

Members

Enhance.PLACEMENT_DEFAULT:String

The default placement of ads, including banner ads.

Enhance.POSITION_TOP:String

The top of the screen, use to set banner ads position.

Enhance.POSITION_BOTTOM:String

The bottom of the screen, use to set banner ads position.

Banner Ads: Defold (Lua)




Banner Ads are small sized ads displayed on the screen as a rectangle filled with content without interrupting the flow of the 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

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

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

Parameters:
optional string placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Returns:
Returns true if any ad is ready, false otherwise.

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

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

Parameters:
optional string placement - Specifies the placement of the ad (describes in what moment the ad is shown).

optional string position - Specifies the position of the ad on the screen("top" or "bottom").

nil enhance.hideBannerAd()

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

Banner Ads: Construct 2 (Visual)




Banner Ads are small sized ads displayed on the screen as a rectangle filled with content without interrupting the flow of the app.

Example Usage

System On start of layout
    Enhance Show banner ad with position Bottom and placement "default"

Enhance On banner ad failed
    Function Call "writeLog" ("Banner ad is not ready")

System On end of layout
    Enhance Hide banner ad

Actions

Enhance Show banner ad

Display a new banner ad if any is currently available. The ad provider is selected based on your app's mediation settings. If this action fails for any reason, the On banner ad failed condition will be triggered.

Parameters:
position - Specifies the position of the ad on the screen (Top or Bottom).

optional placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Enhance Hide banner ad

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

Conditions

Enhance On banner ad failed

Triggered when Enhance failed to show the ad (e.g. received no fill error from the ad network).

Banner Ads: Cordova (JS)




Banner Ads are small sized ads displayed on the screen as a rectangle filled with content without interrupting the flow of the 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

void Enhance.isBannerAdReady( resultCallback, placement = 'default' )

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

Parameters:
function resultCallback - Specifies the function which will receive a response (true or false).

optional string placement - Specifies the placement of the ad (describes in what moment the ad is shown).

void Enhance.showBannerAdWithPosition( position, placement = 'default' )

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

Parameters:
string position - Specifies the position of the ad on the screen.

optional string placement - Specifies the placement of the ad (describes in what moment the ad is shown).

void Enhance.hideBannerAd()

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

Members

string Enhance.Position.TOP

The top of the screen, use to set banner ads position.

string Enhance.Position.BOTTOM

The bottom of the screen, use to set banner ads position.

Banner Ads: Stencyl (Visual)




Banner Ads are small sized ads displayed on the screen as a rectangle filled with content without interrupting the flow of the app.

Example Usage


Action Blocks



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

Parameters:
position - Specifies the position of the ad on the screen (top or bottom).



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

Parameters:
position - Specifies the position of the ad on the screen (top or bottom).

text placement - Specifies the placement of the ad (describes in what moment the ad is shown).



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

Normal Blocks



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

Returns:
Returns true if any ad is ready, false otherwise.



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

Parameters:
text placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Returns:
Returns true if any ad is ready, false otherwise.

Banner Ads: Construct 3 (Visual)




Banner Ads are small sized ads displayed on the screen as a rectangle filled with content without interrupting the flow of the app.

Example Usage

System On start of layout
    Enhance Show banner ad with position bottom and placement Enhance.PLACEMENT_DEFAULT

Enhance On banner ad failed
    Browser Alert "Banner ad is not ready"

System On end of layout
    Enhance Hide banner ad

Actions

Enhance Show banner ad

Display a new banner ad if any is currently available. The ad provider is selected based on your app's mediation settings. If this action fails for any reason, the On banner ad failed condition will be triggered.

Parameters:
position - Specifies the position of the ad on the screen (top or bottom).

optional placement - Specifies the placement of the ad (describes in what moment the ad is shown). The default value is Enhance.PLACEMENT_DEFAULT.

Enhance Hide banner ad

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

Conditions

Enhance On banner ad failed

Triggered when Enhance failed to show the ad (e.g. received no fill error from the ad network).

Expressions

string Enhance.PLACEMENT_DEFAULT

The default placement of ads.

Banner Ads: Xamarin (C#)




Banner Ads are small sized ads displayed on the screen as a rectangle filled with content without interrupting the flow of the 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

bool Enhance.IsBannerAdReady( string placement = Enhance.DEFAULT_PLACEMENT )

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

Parameters:
optional string placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Returns:
Returns true if any ad is ready, false otherwise.

void Enhance.ShowBannerAdWithPosition( Enhance.Position position, string placement = Enhance.DEFAULT_PLACEMENT, )

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

Parameters:
Enhance.Positionposition - Specifies the position of the ad on the screen.

optional stringplacement - Specifies the placement of the ad (describes in what moment the ad is shown).

void Enhance.HideBannerAd()

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

Members

string Enhance.DEFAULT_PLACEMENT

The default placement of ads, including banner ads.

enum Enhance.Position.Top

The top of the screen, use to set banner ads position.

enum Enhance.Position.Bottom

The bottom of the screen, use to set banner ads position.

Banner Ads: MIT App Inventor (Visual)




Banner Ads are small sized ads displayed on the screen as a rectangle filled with content without interrupting the flow of the app.

Example Usage

when ShowBannerButton.Click
do
    if      call EnhanceConnector1.IsBannerAdReady
    then    call EnhanceConnector1.ShowBannerAdWithPosition
                 position = "bottom"
    else    call Notifier1.ShowAlert
                 notice = "Banner ad is not ready"

when HideBannerButton.Click
do
    call EnhanceConnector1.HideBannerAd

Methods

boolean IsBannerAdReady

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

Returns:
Returns true if any ad is ready, false otherwise.

boolean IsBannerAdReadyForPlacement

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

Parameters:
text placement - Specifies the placement of the ad (describes in what moment the ad is shown).

Returns:
Returns true if any ad is ready, false otherwise.

void ShowBannerAdWithPosition

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

Parameters:
textposition - Specifies the position of the ad on the screen ("top" or "bottom").

void ShowBannerAdWithPositionAndPlacement

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

Parameters:
textposition - Specifies the position of the ad on the screen ("top" or "bottom").

textplacement - Specifies the placement of the ad (describes in what moment the ad is shown).

void HideBannerAd

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

Banner Ads: Construct 3 (Visual)




Banner Ads are small sized ads displayed in the top or bottom of the app.

Actions

Show banner ad
Try to show a banner ad with position.

Hide banner ad
Hide the banner ad if shown.

Conditions

On banner ad failed
Triggered when Enhance failed to show the ad (e.g. received no fill error from the ad network).

Is banner ad shown
Check whether any banner ad is currently displayed.

Note:
You can also integrate Fixed Banner Ads through Enhance ZeroCode with no coding at all.

Banner Ads: Xamarin (C#)




Banner Ads are small sized ads displayed in the top or bottom of the app.

1) Check whether any ad is available:
bool isReady = Enhance.IsBannerAdReady();

2) Display the ad:
Enhance.ShowBannerAdWithPosition(Enhance.Position position);

Available positions:
Enhance.Position.Top
Enhance.Position.Bottom

3) Hide the ad:
Enhance.HideBannerAd();

Banner Ads: MIT App Inventor (Visual)




Banner Ads are small sized ads displayed in the top or bottom of the app.

1) Check whether any ad is available:
IsBannerAdReady

2) Display the ad:
ShowBannerAd (Text position)

Available positions:
"top"
"bottom"

3) Hide the ad:
HideBannerAd

Note:
You can also integrate Fixed Banner Ads through Enhance ZeroCode with no coding at all.