# 전면 배너

## 1. **전면배너 삽입**

* 전면 형태의 배너 광고물이 노출됩니다.
* 전면 배너의 종류로는 전면 확장, 전면 팝업(배경 투명, 배경 회색), 전면 동영상이 있습니다.

{% hint style="info" %}
아래와 같은 전면 형태의 배너 노출
{% endhint %}

<div align="left"><figure><img src="https://583392291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxdbgD34XdoBdrVCIm02M%2Fuploads%2FRfJuuczeU8lJ2NAR6fum%2Fimage.png?alt=media&#x26;token=509af179-f5ed-4296-8e32-fbf0466c2dfc" alt="" width="188"><figcaption></figcaption></figure> <figure><img src="https://583392291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxdbgD34XdoBdrVCIm02M%2Fuploads%2FwenuTIVahkxhWdxT0z4i%2Fimage.png?alt=media&#x26;token=e34be2f6-2dca-42db-9394-48b66295ba7c" alt="" width="188"><figcaption></figcaption></figure> <figure><img src="https://583392291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxdbgD34XdoBdrVCIm02M%2Fuploads%2FIsinahqPqrp24imJynXv%2Fimage.png?alt=media&#x26;token=0187ff78-272a-428d-b253-9fedc65c6c55" alt="" width="188"><figcaption></figcaption></figure> <figure><img src="https://583392291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxdbgD34XdoBdrVCIm02M%2Fuploads%2FBJdFQktDhxfX78lwGUDC%2Fimage.png?alt=media&#x26;token=439592a6-8cab-48ca-9903-7fdbb42f5f4e" alt="" width="188"><figcaption></figcaption></figure> <figure><img src="https://583392291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxdbgD34XdoBdrVCIm02M%2Fuploads%2FUb00yST2zzkD4p09H55S%2Fimage.png?alt=media&#x26;token=6e54b094-9138-4b7e-81b9-def28767eb11" alt="" width="153"><figcaption></figcaption></figure></div>

## **2. 전면 광고 연동**

{% hint style="info" %}
Interstitial 광고 객체 설정 (필수 세팅)
{% endhint %}

{% code lineNumbers="true" %}

```swift
//Model
let model = ADMZInterstitialModel(withPublisherID: 100,
    withMediaID: 200,
    withSectionID: 804313,
    withKeywordParameter: "KeywordTargeting",
    withOtherParameter: "BannerAdditionalParameters",
    withMediaAgeLevel: .under13Age,
    withAppID:"appID",
    withAppName: "appName",
    withStoreURL: "StoreURL",
    withSMS: true,
    withTel: true,
    withCalendar: true,
    withStorePicture: true,
    withInlineVideo: true,
    withPopupType: .FullSize)
```

{% endcode %}

{% hint style="info" %}
전면광고 이용자 정보 입력(선택 세팅)
{% endhint %}

{% code lineNumbers="true" %}

```swift
// 유저 정보 세팅                                          
model.setUserInfo(withGenderType: .Male,
    withAge: 15,
    withUserID: "mezzomedia",
    withEmail: "mezzo@mezzomedia.co.kr",
    withUserLocationAgree: false)
```

{% endcode %}

{% hint style="info" %}
전면 광고 요청 시작 및 이벤트 Handler설정&#x20;
{% endhint %}

{% code lineNumbers="true" %}

```swift
// 전면 광고 요청 시작 및 이벤트 Handler설정
ADMZInterstitialLoader.presentAd(fromViewController:self,withModel: model,withSuccessHandler: { code in
}, withFailedHandler: { code in
}, withOtherEventHandler: { code in
})       
```

{% endcode %}

## **3. 코드 설명**

| 코드                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | 설명                                                                                                                                                                                                                                                                                                                                                                                                                    |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>let model = ADMZInterstitialModel(withPublisherID: 100,<br>     withMediaID: 200,<br>     withSectionID: 804313,<br>     withKeywordParameter: “KeywordTargeting”,<br>     withOtherParameter: “BannerAdditionalParameters”,<br>     withMediaAgeLevel: .under13Age,<br>     withAppID:”appID”,<br>     withAppName: “appName”,<br>     withStoreURL: “StoreURL”,<br>     withSMS: true,<br>     withTel: true,<br>     withCalendar: true,<br>     withStorePicture: true,<br>     withInlineVideo: true,<br>     withPopupType: .FullSize)</p> | <p>요청할 정보를 가지고있는 모델을 생성합니다.<br>- PublisherID: 퍼블리셔 ID<br>- MediaID: 미디어 ID<br>- SectionID: 섹션 ID<br>- KeywordParameter: 검색어<br>- OtherParameter: 기타 파라미터<br>- MediaAgeLevel: 사용자 연령대<br>- AppID: 앱 ID<br>- AppName: 앱 이름<br>- StoreURL: 앱스토어 URL<br>- SMS: 문자 사용 여부<br>- Tel: 전화번호 사용 여부<br>- Calendar: 캘린더 저장 사용 여부<br>- StorePicture: 스토어 이미지 사용 여부<br>- InlineVideo: 인라인 비디오 사용 여부<br>- PopupType: 전면 광고 팝업 타입</p> |
| <p>ADMZInterstitialLoader.presentAd(fromViewController:self,<br>    withModel: model,<br>    withSuccessHandler: { code in<br>               },<br>     withFailedHandler: { code in<br>               },<br>     withOtherEventHandler: { code in<br>               })</p>                                                                                                                                                                                                                                                                         | <p>전면 팝업광고 요청을 시작합니다.<br>- fromViewController : 성공시 팝업으로 올라올 Target ViewController<br>(null일경우 현재 최상단의 ViewController를 체크후 해당 ViewController위에 Popup으로 띄웁니다.)<br>- Model: 요청정보를 설정한 ADMZInterstitialModel<br>- SuccessHandler : 성공시 성공코드를 code 변수로 리턴합니다.<br>- FailHandler : 실패시 실패코드를 code 변수로 리턴합니다.<br>- OtherHandler : 성공 실패 외의 이벤트코드를 code 변수로 리턴합니다.<br>(ex: 광고 선택, 로고 선택 등)</p>                                |
