> For the complete documentation index, see [llms.txt](https://docs.targetpick.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.targetpick.io/ios-sdk/bar-banner.md).

# 띠 배너

## 1. **띠배너 삽입**

* 띠형태의 배너 광고물로 정의한 위치에 노출됩니다.
* TARGETPICK 광고 정책으로 정해져 있는 320x50, 320x100 사이즈입니다.

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

<div align="left"><figure><img src="/files/6VSW07dFuVzlYxzQKTxc" alt="" width="188"><figcaption></figcaption></figure> <figure><img src="/files/Gq4hR3rnQPTTBHZF0Kr8" alt="" width="188"><figcaption></figcaption></figure> <figure><img src="/files/UqAgnZwdjhljqJ2cwcRV" alt="" width="229"><figcaption></figcaption></figure></div>

## **2. 띠배너 연동 방식**

{% hint style="info" %}
아래의 Sample code는 Swift 기준
{% endhint %}

{% code lineNumbers="true" %}

```java
@IBOutlet var banner:ADMZBannerView!
```

{% endcode %}

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

{% code lineNumbers="true" %}

```swift
//Model
let model = ADMZBannerModel(withPublisherID: 102,
    withMediaID: 202,
    withSectionID: 804231,
    withBannerSize: .init(width: 414.0, height: 40.0),
    withKeywordParameter: "KeywordTargeting",
    withOtherParameter: "BannerAdditionalParameters",
    withMediaAgeLevel: .over13Age,
    withAppID:"appID",
    withAppName: "appName",
    withStoreURL: "StoreURL",
    withSMS: true,
    withTel: true,
    withCalendar: true,
    withStorePicture: true,
    withInlineVideo: true,
    withBannerType:.Strip)        
banner?.updateModel(value: model)  
```

{% endcode %}

{% hint style="info" %}
배너광고 이용자 정보 입력 – (선택 세팅)&#x20;
{% endhint %}

{% code lineNumbers="true" %}

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

{% endcode %}

## **3. 이벤트 구현**

{% hint style="info" %}
Handler 발생에 따른 이벤트 구현
{% endhint %}

{% code lineNumbers="true" %}

```swift
banner?.setFailHandler(value: { code in
    //Fail event 발생시 code 변수에 실패코드가 나타납니다.
})

banner?.setSuccessHandler(value: { code in
    //Success event 발생시 code 변수에 해당코드가 나타납니다.
})

banner?.setOtherHandler(value: { code in
    //배너 선택, 로고 선택등의 이벤트가 발생시 code 변수에 이벤트코드가 나타납니다.
})
```

{% endcode %}

## **4. 띠배너 광고 시작**

{% code lineNumbers="true" %}

```swift
// 띠배너 광고 시작.
banner?.startBanner()
```

{% endcode %}

## **5. 띠배너 광고 종료**

{% code lineNumbers="true" %}

```swift
// 띠배너 광고 종료
banner?.stopBanner()
```

{% endcode %}

## **6. 코드 설명**

| 코드                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | 설명                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>let model = ADMZBannerModel(withPublisherID: 102,<br>     withMediaID: 202,<br>     withSectionID: 804231,<br>     withBannerSize: .init(width: 414.0, height: 40.0),<br>     withKeywordParameter: “KeywordTargeting”,<br>     withOtherParameter: “BannerAdditionalParameters”,<br>     withMediaAgeLevel: .over13Age,<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>     withBannerType:.Strip)</p> | <p>요청할 정보를 가지고있는 모델을 생성합니다.<br>- PublisherID : 발급받은 publisherID<br>- MediaID : 발급받은 mediaID<br>- SectionID : 발급받은 sectionID<br>- BannerSize : 배너 사이즈<br>- KeywordParameter : 키워드 파라미터<br>- otherParam: 기타 파라미터<br>- ageLvType: 사용자 연령 대분류<br>- Appid: 앱 ID<br>- AppName: 앱 이름<br>- StoreURL: 앱스토어 URL<br>- SMS: 문자 사용 여부<br>- Tel: 전화번호 사용 여부<br>- Calendar: 캘린더 추가 여부<br>- StorePicture: 스토어 이미지 사용 여부<br>- InlineVideo: 인라인 비디오 사용 여부<br>- BannerType: 배너 광고 유형(.Strip : 띠배너, .Front: 전면광고)</p> |
| <p>model.setUserInfo(withGenderType: .Male,<br>     withAge: 15,<br>     withUserID: “mezzomedia”,<br>     withEmail: “<mezzo@mezzomedia.co.kr>”,<br>     withUserLocationAgree: false)</p>                                                                                                                                                                                                                                                                                                                                                                                                          | <p>사용자 정보를 입력합니다(선택사항)<br>- Gender: 성별<br>- Age: 나이<br>- UserID: 사용자 아이디<br>- UserEmail: 사용자 이메일<br>- UserLocationAgree: 위치정보 사용동의여부</p>                                                                                                                                                                                                                                                                                                                                                          |
| banner?.startBanner()                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | 광고요청을 시작합니다                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| <p>banner?.setFailHandler(value: { code in<br>               })<br><br>banner?.setSuccessHandler(value: { code in<br>               })<br><br>banner?.setOtherHandler(value: { code in<br>               })</p>                                                                                                                                                                                                                                                                                                                                                                                      | <p>- 이벤트를 전달하는 코드입니다.<br>FailHandler : 실패시 실패코드를 code 변수로 리턴합니다.<br>SuccessHandler : 성공시 성공코드를 code 변수로 리턴합니다.<br>OtherHandler : 성공 실패 외의 이벤트코드를 code 변수로 리턴합니다.<br>(ex: 광고 선택, 로고 선택 등)</p>                                                                                                                                                                                                                                                                                                      |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.targetpick.io/ios-sdk/bar-banner.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
