ドキュメント

​
​

Development

User Acquisition

Monetization

産業

Unity Ads Monetization

SDK 4.20.0

サポート対象
​

iOS API reference - Swift

iOS API reference - Objective-C

Unity Ads Monetization

SDK 4.20.0

サポート対象
​

このページは選択した言語では使用できません。
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.
読み終わるまでの所要時間 2 分
最終更新 1ヶ月前

重要
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.
注
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

注
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
法規事項プライバシーポリシークッキーDocumentation Terms of Use私の個人情報を販売または共有しないプライバシーに関する選択 (クッキー設定)

"Unity" の名称、Unity のロゴ、およびその他の Unity の商標は、米国およびその他の国における Unity Technologies またはその関係会社の商標または登録商標です (詳しくはこちら)。その他の名称またはブランドは該当する所有者の商標です。

一部のページは利便性向上のため機械翻訳を使用しており、内容に不正確な表現が含まれる場合があります。内容に齟齬または不一致が生じた場合は、英語版を正本とします。

  • このページ
    • Script implementation

      • Implementing the MREC banner format

        • Banner ad load example


このページの問題を報告する