# 팝콘텐츠 광고

{% hint style="info" %}
팝콘텐츠 광고는 Flutter plugin v1.0.9(Android v3.7.4, iOS v2.9.4 이상)부터 지원합니다.
{% endhint %}

{% hint style="danger" %}
팝콘텐츠 광고를 노출 시키고자 할 경우, 반드시 유저 식별값 설정을 진행해 주어야 합니다.
{% endhint %}

## 1. 유저 식별값 입력

유저 식별값은 콘텐츠 광고 페이지내 광고 완료 시 유저에게 정확한 리워드를 지급하기 위해 사용되는 값입니다.

{% hint style="danger" %}
**주의 사항**

1. 1명의 유저는 1개의 고유한 유저 식별값을 가져야 하며, 가변적인 값을 사용해서는 안됩니다.
2. 개인정보(이메일, 이름, 전화번호, 식별 가능한 유저 아이디 등)이 포함되어서는 안됩니다.
3. 한글, 특수 문자, 공백 등이 포함된 경우에는 반드시 URL 인코딩 처리를 하여 사용하여야 합니다.
4. openPopContents API를 호출하기 전에 설정되어야 합니다.
   {% endhint %}

위 주의사항에 유의하여 유저 식별값을 입력합니다.

```dart
AdPopcornSSP.setUserId('TEST_USN');
```

## 2. 팝콘텐츠 페이지 오픈

<mark style="color:red;">`openPopContents()`</mark> API를 호출하여 콘텐츠 페이지를 오픈합니다.

{% code title="Dart" %}

```dart
AdPopcornSSP.openPopContents('your_app_key', 'your_placement_id');
```

{% endcode %}

## 3. 이벤트 연동

팝콘텐츠 페이지 이벤트를 받는 설정을 진행할 수 있습니다. 원하는 이벤트만 연동하여 사용하면 됩니다.

{% code title="Dart" %}

```dart
AdPopcornSSP.popContentsAdOpenSuccessListener = () {
};
AdPopcornSSP.popContentsAdOpenFailListener = () {
};
AdPopcornSSP.popContentsAdClosedListener = () {
};
```

{% endcode %}

<table><thead><tr><th width="418">이벤트</th><th>설명</th></tr></thead><tbody><tr><td>AdPopcornSSP.popContentsAdOpenSuccessListener </td><td>팝콘텐츠 페이지 오픈 성공</td></tr><tr><td>AdPopcornSSP.popContentsAdOpenFailListener </td><td>팝콘텐츠 페이지 오픈 실패</td></tr><tr><td>AdPopcornSSP.popContentsAdClosedListener </td><td>팝콘텐츠 페이지 닫기</td></tr></tbody></table>

## 4. 샘플 코드

<pre class="language-dart" data-title="Dart"><code class="lang-dart"><strong>AdPopcornSSP.openPopContents('your_app_key', 'your_placement_id');
</strong>AdPopcornSSP.popContentsAdOpenSuccessListener  = () {
};

AdPopcornSSP.popContentsAdOpenFailListener = () {
};

AdPopcornSSP.popContentsAdClosedListener = () {
};
</code></pre>


---

# Agent Instructions: 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:

```
GET https://adpopcornssp.gitbook.io/ssp-sdk/sdk/flutter/undefined-7.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
