Get Started with Avocarrot

Overview

Examples

Android

Overview

- Avocarrot Exchange SDK

Setup Exchange SDK

Stream

Native Assets

Exchange Troubleshooting

- Avocarrot Mediation SDK

Setup Mediation

Stream Ads Mediation

Native ads Mediation

Native Assets Mediation

Banner Mediation

Interstitial Mediation

Video Mediation

Supported Networks & Ad Types

Mediation Troubleshooting

iOS

Overview

- Avocarrot Exchange SDK

Setup SDK

Stream

Native Assets

Exchange Troubleshooting

- Avocarrot Mediation

Getting Started With Mediation

Stream Ads Mediation

Native Ads Mediation

Banner Ads Mediation

Interstitial Ads Mediation

Video Ads Mediation

Supported Networks & Ad Types

Mediation Troubleshooting

API Documentation

Reporting API

Help

FAQ

Updates

SDK Change Log

Android Change Log

iOS Change Log

Banner Ads Mediation

Updated 2 months ago ​by Chris

Overview

This guide helps you setup Banner mediation.

Prerequisites

You need an Avocarrot account to complete the tutorial. Create an account
You need to setup the Mediation SDK. Setup Mediation SDK

Setup Banner Mediation

ID of advertising space for testing (STANDARD): "04c447d7-ffb8-4ba1-985e-4d2b9f88cd69"

The ID above is meant for testing purpose only, please replace it with the Ad unit Id of your placement from the dashboard .

Available banner sizes:

  • AVOBannerViewSizeSmall (320x50) (recommended)
  • AVOBannerViewSizeLarge (728x90)
  1. Use the following methods in your UIViewController subclass:
    - (AVOBannerView *_Nullable)loadBannerWithSize:(AVOBannerViewSize)size
                                adUnitId:(NSString *_Nonnull)adUnitId
                                success:(void (^ _Nullable)(void))success
                                failure:(void (^ _Nullable)(AVOError *_Nonnull error))failure;
    

    For example:

    #import <AvocarrotBanner/AvocarrotSDK+AVOBannerView.h>
    ...
    [self.bannerView stop];
    self.bannerView = [AvocarrotSDK.sharedSDK loadBannerWithSize:AVOBannerViewSizeSmall
                                           adUnitId:@"04c447d7-ffb8-4ba1-985e-4d2b9f88cd69"
                                           success:nil
                                           failure:nil];
    [self.view addSubview:self.bannerView];
    
    import AvocarrotBanner
    ...
    if bannerView != nil {
        bannerView?.stop()
        bannerView?.removeFromSuperview()
        bannerView = nil
    }
    bannerView = AvocarrotSDK.shared.loadBanner(with: AVOBannerViewSizeSmall,
                                               adUnitId: "04c447d7-ffb8-4ba1-985e-4d2b9f88cd69",
                                             success: nil,
                                             failure: nil)
    
  2. Add the following code to viewDidAppear and viewWillDisappear methods:
    #import <AvocarrotBanner/AvocarrotSDK+AVOBannerView.h>
    ...
    - (void)viewDidAppear:(BOOL)animated {
        [super viewDidAppear:animated];
        [self.bannerView resumeAutoUpdate];
    }
    - (void)viewWillDisappear:(BOOL)animated {
        [super viewWillDisappear:animated];
        [self.bannerView pauseAutoUpdate];
    }
    
    import AvocarrotBanner
    ...
    override func viewDidAppear(animated: Bool) {
        bannerView?.resumeAutoUpdate()
    }
    override func viewDidDisappear(animated: Bool) {
        bannerView?.pauseAutoUpdate()
    }
    
  3. If you want to switch banner auto-update off:
    self.bannerView.autoUpdate = NO;
    
  4. If you want to stop and remove banner from screen:
    [self.bannerView stop];
    

Standard banner events handling

To process banner events, you should implement blocks or subscribe to notifications:

MethodDescriptionNSNotificationCenter key
(void (^ _Nullable)(void))successCalled after the banner is served successfully.
(void (^ _Nullable)(AVOError *_Nonnull error))failureCalled if the banner was not downloaded.
- (instancetype _Nonnull)onClick:(nullable void (^)(void))blockCalled after a click on a banner. After this event app will be minimized and an external browser will be opened.kAVONotification_BannerClicked


Advanced Customization

Go Live!

  1. Remove sandbox. If you have received a sample ad then simply disable the Sandbox mode by including the following instruction in your code:
    AvocarrotSDK.testMode = NO
    You should disable Sandbox mode ONLY when you are done with the integration and you are ready to publish your app. It is against Avocarrot's policies to use live ads during development, and doing so could get your Avocarrot account banned.
  2. Publish app. You are now ready to upload your app and start making money! If you have submitted your app in the Google Play/ Apple Store and you can see live ads, then you have nothing to worry about. Just wait until the impressions threshold has been reached and the app will be shown as live in your dashboard as well.
  3. Update payment details. Log in to your account and update your payment settings.

Was this article useful?