기술 자료

​
​

Development

User Acquisition

Monetization

산업 분야

Unity Ads Monetization

Unity Ads Android SDK

Unity Ads iOS SDK

Unity Ads SDK

Unity Ads Monetization

Unity Ads Monetization
​
​
iOS 개발자 가이드
  • iOS SDK 개요
  • 연동 요구 사항
  • iOS용 Unity Ads SDK 설치
  • iOS에서 SDK 초기화
  • iOS에서 인터스티셜 광고 구현
  • iOS에서 보상형 광고 구현
  • iOS에서 배너 광고 구현
iOS 14 연동
  • iOS 14 기술 연동
  • iOS 14용 Unity Ads SDK 업데이트
  • iOS 14 지원 패키지 설치
  • 광고 네트워크 ID 구성
  • App Tracking Transparency 규정 준수
iOS SDK API 레퍼런스
  • iOS용 Unity Ads API 레퍼런스 (Objective-C)
  1. 게임 성장
  2. Unity Ads
  3. iOS 개발자용 Unity Ads SDK 연동 가이드

iOS에서 배너 광고 구현

iOS 앱에서 배너 광고를 구현합니다. 뷰 계층 구조에서 배너 뷰 오브젝트를 생성하고 표시하고 델리게이트를 사용하여 광고 이벤트를 관리합니다.
읽는 시간 3분
최근 업데이트: 7시간 전

중요
app-ads.txt는 광고 생태계의 부정 행위를 근절하고 투명성을 구축하기 위한 IAB 이니셔티브입니다. 설명된 대로 app-ads.txt를 구현해야 합니다. 그렇지 않으면 배너 수요가 크게 줄어듭니다.
배너 광고를 사용하려면 특정 유형의 배너 전용 광고 유닛이 필요합니다.
다른 뷰와 마찬가지로 배너 뷰 오브젝트를 뷰 계층 구조에 배치할 수 있습니다. 그러면 각 배너 인스턴스의 위치를 커스터마이즈하거나 여러 배너를 표시할 수 있습니다.
참고
배너 콘텐츠는 Apple 가이드라인에서 설명한 대로 안전 영역 외부에서 렌더링되지 않습니다.

스크립트 구현

배너 코드를
ViewController
구현부(
.m
)에 추가합니다. 다음 스크립트 샘플은 두 가지 배너 광고를 화면에 표시하는 구현 예제입니다. 참조한 클래스에 대한 자세한 내용은
UADSBannerView
API 섹션을 참조하십시오.

MREC 배너 포맷 구현

참고
Unity Ads를 초기화한 후 배너 광고를 표시해야 합니다.
앱에 MREC(중간 직사각형) 크기의 광고 포맷을 표시하려면 300x250, 300x300, 450x450과 같이 적절한 크기를 사용해야 합니다. 특히 300x250 MREC 배너 광고의 경우 다음 예제 코드에서 아래 값을 변경합니다.
CGSizeMake(320, 50)
조정된 크기는 다음과 같습니다.
CGSizeMake(300, 250)

배너 광고 예시

@interface ViewController () <UADSBannerViewDelegate>​​// This is the Ad Unit or Placement that will display banner ads:@property (strong) NSString* placementId;// This banner view object will be placed at the top of the screen:@property (strong, nonatomic) UADSBannerView *topBannerView;// This banner view object will be placed at the bottom of the screen:@property (strong, nonatomic) UADSBannerView *bottomBannerView;​​@end​​@implementation ViewController​​- (void)viewDidLoad { [super viewDidLoad]; self.placementId = @"banner"; [UnityAds initialize: @"1234567" testMode: YES initializationDelegate: self];}​​// Example method for creating and loading the top banner view object:- (void)loadTopBanner{ // Instantiate a banner view object with the Ad Unit ID and size: self.topBannerView = [[UADSBannerView alloc] initWithPlacementId: _placementId size: CGSizeMake(320, 50)]; // Set the banner delegate for event callbacks: self.topBannerView.delegate = self; // Add the banner view object to the view hierarchy: [self addBannerViewToTopView:self.topBannerView]; // Load ad content to the banner view object: [_topBannerView load];}​​// Example method for creating and loading the bottom banner view object:- (void)loadBottomBanner{ self.bottomBannerView = [[UADSBannerView alloc] initWithPlacementId: _placementId size: CGSizeMake(320, 50)]; self.bottomBannerView.delegate = self; [self addBannerViewToBottomView:self.bottomBannerView]; [_bottomBannerView load];}​​// Example method for discarding the top banner view object (for example, if there's no fill):- (void)unLoadTopBanner{ // Remove the banner view object from the view hierarchy: [self.topBannerView removeFromSuperview]; // Set it to nil: _topBannerView = nil;}​​// Example method for discarding the bottom banner view object:- (void)unLoadBottomBanner{ [self.bottomBannerView removeFromSuperview]; _bottomBannerView = nil;}​​​// Example method for placing the top banner view object:- (void)addBannerViewToTopView:(UIView *)bannerView { bannerView.translatesAutoresizingMaskIntoConstraints = NO; [self.view addSubview:bannerView]; [self.view addConstraints:@[ [NSLayoutConstraint constraintWithItem:bannerView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.topLayoutGuide attribute:NSLayoutAttributeBottom multiplier:1 constant:0], [NSLayoutConstraint constraintWithItem:bannerView attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeCenterX multiplier:1 constant:0] ]];}​// Example method for placing the bottom banner view object:- (void)addBannerViewToBottomView: (UIView *)bannerView { bannerView.translatesAutoresizingMaskIntoConstraints = NO; [self.view addSubview:bannerView]; [self.view addConstraints:@[ [NSLayoutConstraint constraintWithItem:bannerView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.bottomLayoutGuide attribute:NSLayoutAttributeTop multiplier:1 constant:0], [NSLayoutConstraint constraintWithItem:bannerView attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeCenterX multiplier:1 constant:0] ]];}​// Implement the delegate methods:#pragma mark : UADSBannerViewDelegate- (void)bannerViewDidLoad:(UADSBannerView *)bannerView { // Called when the banner view object finishes loading an ad. NSLog(@"Banner loaded for Ad Unit or Placement: %@", bannerView.placementId);}- (void)bannerViewDidClick:(UADSBannerView *)bannerView { // Called when the banner is clicked. NSLog(@"Banner was clicked for Ad Unit or Placement: %@", bannerView.placementId);}- (void)bannerViewDidLeaveApplication:(UADSBannerView *)bannerView { // Called when the banner links out of the application.}- (void)bannerViewDidError:(UADSBannerView *)bannerView error:(UADSBannerError *)error{ // Called when an error occurs showing the banner view object. NSLog(@"Banner encountered an error for Ad Unit or Placement: %@ with error message %@", bannerView.placementId, [error localizedDescription]); // Note that the UADSBannerError can indicate no fill (refer to the API documentation).}@end
다음 단계: 수익화 전략 가이드를 검토하고 구현 내용을 테스트하십시오.

Copyright © 2026 Unity Technologies
법률 정보개인정보 처리방침쿠키Documentation Terms of Use개인 정보 판매 또는 공유 금지개인정보 보호 선택(쿠키 설정)

'Unity', Unity 로고 및 기타 Unity 상표는 미국 및 기타 지역 내 Unity Technologies 또는 그 계열사의 상표 또는 등록상표입니다(자세한 내용은 여기에서 확인하세요). 기타 명칭 또는 브랜드는 해당 소유자의 상표입니다.

일부 페이지는 편의를 위해 기계 번역되었으며 부정확한 내용이 있을 수 있습니다. 정보가 상충되는 경우, 영어 버전을 우선으로 참조하세요.

  • 보고 있는 페이지
    • 스크립트 구현

      • MREC 배너 포맷 구현

        • 배너 광고 예시


이 페이지의 문제 보고