Documentation

​
​

Development

User Acquisition

Monetization

Industry

Unity Ads Monetization

SDK 4.20.0

Supported
​

iOS API reference - Swift

iOS API reference - Objective-C

Unity Ads Monetization

SDK 4.20.0

Supported
​

iOS developer guides
​
​
iOS developer guides
  • iOS SDK integration guide
  • Unity Ads privacy guide
  • Unity Ads SDK troubleshooting guide
  • iOS developer API references - Swift
  • iOS developer API references - Objective-C
  1. Unity Ads SDK iOS developer monetization
  2. Unity Ads SDK integration guide for iOS developers

Implement banner ads in iOS

Implement banner ads in your iOS app. Create and display banner view objects within your view hierarchy, and use a delegate to manage ad events.
Read time 2 minutes
Last updated a month ago

Important
app-ads.txt is an IAB initiative to combat fraud and create transparency in the advertising ecosystem. Ensure that you implement app-ads.txt as described. Otherwise, banner demand might significantly decrease.
You can place the banner view object into your view hierarchy, just like you would any other view. This allows you to customize the position of each banner instance, or display multiple banners.
Note
Banner content will not render outside of the Safe Area, as described in Apple's guidelines.

Script implementation

The following script sample is an example implementation for displaying two banner ads on the screen. For more information on the classes referenced, refer to the
UADSBannerAd
API section.

Implementing the MREC banner format

Note
You must initialize Unity Ads before displaying a banner ad.
To display a medium rectangle (MREC) sized ad format in your app, ensure the proper dimensions are used, such as 300x250, 300x300, or 450x450. In the case of a 300x250 MREC banner ad specifically, replace this in the following example code:
CGSizeMake(320, 50)
With this adjusted dimension:
CGSizeMake(300, 250)

Banner ad load example

@interface MyDelegate : NSObject <UADSBannerAdDelegate>@end@implementation MyDelegate- (void)bannerImpression:(UADSBannerAd *)banner {}- (void)bannerDidClick:(UADSBannerAd *)banner {}- (void)bannerDidFailShow:(UADSBannerAd *)banner error:(id<UnityAdsError>)error {}@end@property (strong) UADSBannerAd *bannerAd;UADSBannerLoadConfigurationBuilder *builder =[[UADSBannerLoadConfigurationBuilder alloc]initWithPlacementId:placementId bannerSize:CGSizeMake(320, 50) delegate:delegate];builder = [builder withMediationInfo:self.mediationInfo];builder = [builder withAdMarkup:bidResponse];[UADSBannerAd load:[builder build] completion:^(UADSBannerAd *ad, id<UnityAdsError> error) {if (!error) { self.bannerAd = ad; [container addSubview:ad.view];}}];
class MyDelegate: NSObject, UADSBannerAdDelegate {func bannerImpression(_ banner: UADSBannerAd) {}func bannerDidClick(_ banner: UADSBannerAd) {}func bannerDidFailShow( _ banner: UADSBannerAd, error: UnityAdsError) { }}var bannerAd: UADSBannerAd?let config = UADSBannerLoadConfigurationBuilder(placementId: placementId,bannerSize: CGSize(width: 320, height: 50),delegate: delegate).with(mediationInfo: mediationInfo).with(adMarkup: bidResponse).build()UADSBannerAd.load(config) { ad, error inif let ad = ad { self.bannerAd = ad container.addSubview(ad.view) }}
Next steps: Review the monetization strategy guide and test your implementation.

Copyright © 2026 Unity Technologies
LegalPrivacy PolicyCookiesDocumentation Terms of UseDo Not Sell or Share My Personal InformationYour Privacy Choices (Cookie Settings)

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S and elsewhere (more info here). Other names or brands are trademarks of their respective owners.

Some pages are machine-translated for convenience, and may contain inaccuracies. In the event of conflicting information, the English version is authoritative.

  • On this page
    • Script implementation

      • Implementing the MREC banner format

        • Banner ad load example


Report a problem with this page