Banner

Banners are small visual ads that appear inside your application covering a small portion of the screen. The ad is not closed by the user, but is instead dismissed programmatically.

Only one banner can be displayed at a time.

As of v5.7.2 will handle the refresh interval itself. Please make sure that the refresh interval in the ad network dashboard is disabled, otherwise you may experience unexpected behaviour

1. Load the banner

Make sure you add the Tapdaq namespace to the top of your script:

using Tapdaq;

The banner needs to be loaded for a specific size. You can see a full list of TDMBannerSizes here.

AdManager.RequestBanner(TDMBannerSize.TDMBannerStandard);

If you would like to load the banner when the application starts, use the TapdaqConfigLoaded listener to guarantee the ad is loaded.

private void OnEnable() {
	TDCallbacks.TapdaqConfigLoaded += OnTapdaqConfigLoaded;
}

private void OnDisable() {
	TDCallbacks.TapdaqConfigLoaded -= OnTapdaqConfigLoaded;
}

private void OnTapdaqConfigLoaded(string message) {
	AdManager.RequestBanner(TDMBannerSize.TDMBannerStandard);
}

2. Display the banner

To display the banner we recommend using the AdAvailable listener. To do this, create a callback method and subscribe it to the AdAvailable listener.

Banners can be placed at the top or bottom of the screen us the TDBannerPosition parameter to set this.

private void OnEnable() {
    TDCallbacks.AdAvailable += OnAdAvailable;
    TDCallbacks.AdNotAvailable += OnAdNotAvailable;
    TDCallbacks.AdClicked += OnAdClicked;
}

private void OnDisable() {
    TDCallbacks.AdAvailable -= OnAdAvailable;
    TDCallbacks.AdNotAvailable -= OnAdNotAvailable;
    TDCallbacks.AdClicked -= OnAdClicked;
}

private void OnAdAvailable(TDAdEvent e) {
    // Ad has loaded, can now be displayed. 
    // This method will also be called when a banner is refreshed every 30 seconds even if the banner is already in view. Calling show again is safe, alternatively TDAdEvent message property will note either "LOADED" or "REFRESH"
    
    if (e.adType == "BANNER") {
        AdManager.ShowBanner(TDBannerPosition.Bottom);
    }
}

public void OnAdNotAvailable (TDAdEvent adEvent) {
    // Ad has failed to load/refresh
}

public void OnAdClicked (TDAdEvent adEvent) {
    // Ad has been clicked
}

It is also possible to check the banner is loaded before displaying it to the user, as shown below:

if (AdManager.IsBannerReady()) {
	AdManager.ShowBanner(TDBannerPosition.Bottom);
}

3. Hide the banner

To hide the banner from the screen at any time, use the following statement:

AdManager.HideBanner();

Export your application to iOS and Android, then run your application to test the ad displays correctly.

4. Banner sizes

TDMBanner sizes

Banner Size AppLovin Facebook Audience Network Google Ad Mob InMobi MoPub
TDMBannerStandard 320x50 320x50 320x50 320x50 320x50
TDMBannerLarge N/A 320x90 320x100 N/A N/A
TDMBannerMedium 300x250 320x250 300x250 300x250 300x250
TDMBannerFull N/A N/A 468x60 N/A N/A
TDMBannerLeaderboard N/A N/A 728x90 N/A 728x90
TDMBannerSmartPortrait N/A Various x 50 Various x 50 N/A N/A
TDMBannerSmartLandscape N/A Various x 50 Various x 50 N/A N/A

Need help?

If you are having any problems integrating, feel free to contact us on [email protected] and we will be more than happy to help.

What's next?

Now that you have successfully integrated a banner into your app, what would you like to do next?