The MVP Unity Developer Hub

Welcome to the MVP Unity developer hub. You'll find comprehensive guides and documentation to help you start working with MVP Unity as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Introduction

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 after a specified period of time.

Important

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

Making an Ad Request

Banner sizes must be configured before they are shown. Once you have set the required size, you must make a request to show the banner.

Implement the code below to make an Ad Request:

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:

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

Hiding the Banner

To hide your banner, use the hide method, as shown below:

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

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:

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:

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

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

    public void OnShow(string placementId)
    {
        // Called when banner shows up
    }
    public void OnClick(string placementId)
    {
        // Called when banner is clicked
    }
}


Banner.SetBannerListener(new MyBannerListener());

Banner


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.