네이티브

circle-info
  • AdWhale SDK를 프로젝트에 추가 해야합니다.

  • Native Ad용으로 발급받은 Ad Unit ID를 사용합니다.

  • 광고를 요청하기 전에 SDK 초기화를 진행합니다.

1. 레이아웃 설정

Native Ad의 경우, 광고에 사용 될 레이아웃을 직접 구성해야 합니다. 필수 구성 요소들은 다음과 같습니다.

  • Title : UILabel

  • Body : UILabel

  • Call To Action : UIButton

  • Profile Name : UILabel

  • Profile Icon Image : UIImageView

  • Media View : AdWhaleMediaView

circle-info

이 요소들은 반드시 포함하여 구성하여 주시고, 광고 컨텐츠를 덮는 View가 없어야 합니다.

또한 텍스트 변경, 이미지 변경, 터치 시 액션 변경 등 광고 컨텐츠에 관련된 부분을 가공하거나 변경하지 않도록 주의 부탁드립니다.

import UIKit
import AdWhaleSDK

class NativeAdView: AdWhaleNativeAdView {

    @IBOutlet var titleLabel: UILabel!
    @IBOutlet var bodyLabel: UILabel!
    @IBOutlet var callToActionButton: UIButton!
    @IBOutlet var profileNameLabel: UILabel!
    @IBOutlet var profileIconView: UIImageView!
    @IBOutlet var adWhaleMediaView: AdWhaleMediaView!
    
    override func adTitleLabel() -> UILabel {
        return titleLabel
    }
    
    override func adBodyLabel() -> UILabel {
        return bodyLabel
    }
    
    override func adCallToActionButton() -> UIButton {
        return callToActionButton
    }
    
    override func adProfileNameLabel() -> UILabel {
        return profileNameLabel
    }
    
    override func adProfileIconView() -> UIImageView {
        return profileIconView
    }
    
    override func adMediaView() -> AdWhaleMediaView {
        return adWhaleMediaView
    }

}

2. 구현

Last updated