Unity Ad Formats

Banners Interstitials Rewarded Ads

Banner Ads

Banners are rectangle ads appearing either at the top or bottom of the screen when the user interacts with your app. The user can view them but cannot dismiss them.

Banners are automatically refreshed by the FairBid SDK after a specified period of time.

Important

The FairBid SDK refreshes banners automatically. To avoid discrepancies with Fyber's and 3rd-party network's reporting, any automatic or manual banner refresh settings on 3rd-party network SDKs must be disabled.

Showing a Banner

Implement the code below to show a Banner

string placementId = "1234";
Banner.Show(placementId);

Providing Banner Position

You can show your banner at the top or bottom of your screen. By default, the banner will be placed at the bottom of the screen.
If you want to change this behavior, use the following code:

Specifying banner position

string placementId = "1234";
BannerOptions bannerOptions = new BannerOptions();
bannerOptions.DisplayAtTheTop();
Banner.Show(placementId, bannerOptions);

Destroying the Banner

Once you have decided that you no longer want to use the banner, you must destroy it.

To destroy the banner, implement the code below:

Destroying the Banner

string placementId = "1234";
Banner.Destroy(placementId);

Adding Callbacks

The callback code below is required for the SDK to properly track the activity of your ad:

Callbacks

public class MyBannerListener : BannerListener
{
    public void OnError(string placementId, string error)
    {
        // Called when an error from placement 'placementId' arises when loading an ad
    }

    public void OnLoad(string placementId)
    {
        // Called when an ad from placement 'placementId' is loaded
    }

    public void OnShow(string placementId, ImpressionData impressionData)
    {
        // Called when banner from placement 'placementId' shows up
    }
    public void OnClick(string placementId)
    {
        // Called when banner from placement 'placementId' is clicked
    }
  
    public void OnRequestStart(string placementId)
    {
        // Called when a banner from placement 'placementId' is going to be requested
    }
}


Banner.SetBannerListener(new MyBannerListener());