> For the complete documentation index, see [llms.txt](https://nsl-solution.gitbook.io/livesolution/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nsl-solution.gitbook.io/livesolution/viewer/sdk-ios/requests.md).

# 뷰어로 요청하기

### 1. 상단 공지 메시지 노출

다음 API를 통해 뷰어 상단에 공지 형태의 메시지를 노출할 수 있습니다.&#x20;

<figure><img src="/files/i05I29a5WjUzJZgCZgc5" alt=""><figcaption></figcaption></figure>

{% code overflow="wrap" %}

```swift
ShoppingLive.showNotice(message: String, imageURL: String? = nil, landingURL: String? = nil)
```

{% endcode %}

<table><thead><tr><th width="136">param</th><th width="109">type</th><th width="112">required</th><th>desc</th></tr></thead><tbody><tr><td>message</td><td>string</td><td>Y</td><td>공지에 노출할 텍스트</td></tr><tr><td>imageUrl</td><td>string</td><td>N</td><td>토스트 좌측 40*40dp 노출 이미지 (120*120px 권장), nil인 경우 디폴트 이미지 노출</td></tr><tr><td>landingUrl</td><td>string</td><td>N</td><td>클릭시 랜딩될 URL, nil인 경우 동작 없음</td></tr></tbody></table>

### 2. 하단 토스트 메시지 노출

다음 API를 통해 뷰어 하단에 토스트 형태의 메시지를 노출할 수 있습니다.

```swift
ShoppingLive.showToastMessage(message: String)
```

<table><thead><tr><th width="136">param</th><th width="109">type</th><th width="112">required</th><th>desc</th></tr></thead><tbody><tr><td>message</td><td>string</td><td>Y</td><td>토스트에 노출할 텍스트</td></tr></tbody></table>

### 3. PIP 기능

{% hint style="warning" %}
해당 externalServiceId에 설정된 PIP 노출 여부가 false인 경우, PIP 관련 기능이 제공되지 않습니다. 설정 변경을 위해서는 네이버 담당자에게 문의해주세요.
{% endhint %}

#### 01 PIP 전환하기

다음 API를 통해 뷰어를 PIP 모드로 전환할 수 있습니다.

```swift
ShoppingLive.presentPIP()
```

#### 02 PIP 모드 여부 확인하기

다음 API를 통해 뷰어가 현재 PIP 모드인지 확인 할 수 있습니다.

```swift
ShoppingLive.isPopupMode // return type Bool
```

### 4. 뷰어 종료 하기

다음 API를 통해 뷰어를 종료할 수 있습니다.

```swift
ShoppingLive.closeViewer()
```

### 5. 뷰어 내 모달 닫기

다음 API를 통해 뷰어 내 모달을 닫을 수 있습니다.

```swift
ShoppingLive.closeModalWebView(completion: (() -> Void)?)
```

<table><thead><tr><th width="136">param</th><th width="146">type</th><th width="112">required</th><th>desc</th></tr></thead><tbody><tr><td>completion</td><td>(() -> Void)?</td><td>N</td><td>모달 종료 완료 콜백</td></tr></tbody></table>

### 6. 뷰어 내 웹뷰 열기

다음 API를 통해 뷰어에서 웹뷰 전환을 사용할 수 있습니다.

```swift
ShoppingLive.pushWebView(urlString: String)
```
