This guide helps you setup Banner ads in your iOS app.
Setup Banner Mediation
ID of advertising space for testing (STANDARD):
Available banner sizes:
- AVOBannerViewSizeSmall (320x50) (recommended)
- AVOBannerViewSizeMREC (300x250)
- AVOBannerViewSizeLarge (728x90)
- 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;
- Add the following code to
- If you want to switch banner auto-update off:
self.bannerView.autoUpdate = NO;
- If you want to stop and remove banner from screen:
Standard banner events handling
To process banner events, you should implement blocks or subscribe to notifications:
|Called after the banner is served successfully.|
|Called if the banner was not downloaded.|
|Called after a click on a banner. After this event app will be minimized and an external browser will be opened.|
To include user data in the SDK, please set up the following properties:
#import <AvocarrotCore/Avocarrot.h> ... + (void)setBirthday:(NSDate *_Nonnull)birthday; + (void)setGender:(AVOUserGender)userGender; + (void)setInterests:(NSArray<NSString *> *_Nonnull)interests;
#import <AvocarrotCore/Avocarrot.h> ... [AvocarrotSDK setGender:AVOUserGenderMale]; [AvocarrotSDK setBirthday:[NSDate date]]; [AvocarrotSDK setInterests:@[@"running", @"shopping", @"fitness", @"sport"]];
- 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 = NOYou 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.
- 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.
- Update payment details. Log in to your account and update your payment settings.