> For the complete documentation index, see [llms.txt](https://adpopcornssp.gitbook.io/ssp-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://adpopcornssp.gitbook.io/ssp-sdk/sdk/flutter/undefined-2.md).

# 전면 광고

## 1. 광고 요청

<mark style="color:red;">`loadInterstitial`</mark> API를 호출하여 전면광고를 요청합니다.

{% code title="Dart" %}

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

{% endcode %}

## 2. 광고 노출

전면 광고가 정상적으로 로딩 완료 된 후, 광고 노출을 하고자 하는 시점에 <mark style="color:red;">`showInterstitial`</mark> API를 호출합니다.

{% code title="Dart" %}

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

{% endcode %}

## 3. 이벤트 연동

광고 요청, 노출에 대한 결과 이벤트를 받는 설정을 진행할 수 있습니다. 원하는 이벤트만 연동하여 사용하면 됩니다.

{% code title="Dart" %}

```dart
AdPopcornSSP.interstitialAdLoadSuccessListener = (placementId) {
};
AdPopcornSSP.interstitialAdLoadFailListener = (placementId, errorCode) {
};
AdPopcornSSP.interstitialAdShowSuccessListener = (placementId) {
};
AdPopcornSSP.interstitialAdShowFailListener = (placementId) {
};
AdPopcornSSP.interstitialAdClickedListener = (placementId) {
};
AdPopcornSSP.interstitialAdClosedListener = (placementId) {
};
```

{% endcode %}

| 이벤트                                            | 설명                                                          |
| ---------------------------------------------- | ----------------------------------------------------------- |
| AdPopcornSSP.interstitialAdLoadSuccessListener | 전면 광고로딩 성공                                                  |
| AdPopcornSSP.interstitialAdLoadFailListener    | 전면 광고 로딩 실패. [에러코드 값](/ssp-sdk/sdk/android/undefined-10.md) |
| AdPopcornSSP.interstitialAdShowSuccessListener | 전면 광고 노출 성공                                                 |
| AdPopcornSSP.interstitialAdShowFailListener    | 전면 광고 노출 실패                                                 |
| AdPopcornSSP.interstitialAdClickedListener     | 전면 광고 클릭                                                    |
| AdPopcornSSP.interstitialAdClosedListener      | 전면 광고 닫기                                                    |

## 4. 샘플 코드

{% code title="Dart" %}

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

AdPopcornSSP.interstitialAdLoadSuccessListener = (placementId) {
  AdPopcornSSP.showInterstitial('your_app_key', 'your_placement_id');
};
```

{% endcode %}
