Banner ads are added as a subview inside your application. Consumers of your application can tap the banner ad to interact with it.

As of v5.7.1 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

To begin preparations for displaying a banner ad, navigate to the header file that you want the banner ad to appear in (e.g. MyViewController.h/ViewController.swift) and add the following:

#import <Tapdaq/Tapdaq.h>

@interface MyViewController : UIViewController <TapdaqDelegate>

@property (nonatomic, strong) UIView *bannerView;

The above code imports Tapdaq to the class, and declares that we will conform to the TapdaqDelegate protocol. We have also added a UIView property to the class, which we will load the banner into.

Please note that you only need to provide import statement once per header file.

Next, add the following command to the implementation file (e.g. MyViewController.m/ViewController.swift) inside a method of your choice to load the banner:

- (void)myMethod {
    [[Tapdaq sharedSession] loadBannerWithSize:TDMBannerStandard completion:^(UIView bannerView) {
        self.bannerView = bannerView;

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

Note: Ads should only be requested once the Tapdaq delegate method -didLoadConfig has been called. This ensures Tapdaq is initialised and ready to begin loading ads. Requesting ads prior to Tapdaq initialising will result in failed ad requests

2. Display the banner

Once this is done, banner can be placed in you view like so:

- (void)methodToShowBanner {
    // Place it at the bottom
    [self.bannerView setFrame:CGRectMake(

    // Add it to your view
    [self.view addSubview:self.bannerView];

3. Hide the banner

To hide the banner, simply remove the UIView from the superview, like so:

[self.bannerView removeFromSuperview];

Build and run your application to test the advert is displayed correctly.

4. Banner sizes

TDMBanner sizes

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

5. Delegates

Implementing the TDAdRequestDelegate protocol allows listening to loading events from ads.

Loaded an ad

Called immediately after an ad has been successfully loaded.

- (void)didLoadAdRequest:(TDAdRequest * _Nonnull)adRequest;

Failed to load an ad

Called when the ad was not able to be loaded.

- (void)adRequest:(TDAdRequest * _Nonnull)adRequest didFailToLoadWithError:(TDError * _Nullable)error;

Implementing the TDBannerAdRequestDelegate protocol allows you to listen to banner refresh requests.

Refresh a banner ad

Called when the ad within the banner view loads another ad.

- (void)didRefreshBannerForAdRequest:(TDAdRequest * _Nonnull)adRequest;

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?