Banner

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:

Objective-C
Swift
#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:

Objective-C
Swift
- (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:

Objective-C
Swift
- (void)methodToShowBanner {
    // Place it at the bottom
    [self.bannerView setFrame:CGRectMake(
        (self.view.frame.size.width-self.bannerView.frame.size.width)/2,
        self.view.frame.size.height-self.bannerView.frame.size.height,
        self.bannerView.frame.size.width,
        self.bannerView.frame.size.height
    )];

    // 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:

Objective-C
Swift
[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 MoPub
TDMBannerStandard 320x50 320x50 320x50 320x50 320x50
TDMBannerLarge N/A 320x90 320x100 N/A N/A
TDMBannerMedium 300x250 300x250 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
TDMBannerSkyscraper N/A N/A N/A N/A 160x600

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?