> For the complete documentation index, see [llms.txt](https://one-admax-organization.gitbook.io/one-admax-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://one-admax-organization.gitbook.io/one-admax-sdk/05.-flutter-plugin-guide/interstitial.md).

# 5-2. 전면 광고 for Flutter

## 사전 작업

{% content-ref url="/pages/HIpQCyVR8FOQSoTDab0B" %}
[05. Flutter-Plugin Guide](/one-admax-sdk/05.-flutter-plugin-guide.md)
{% endcontent-ref %}

## 전면 광고 인스턴스 생성

```java
 ...
 OAMInterstitial _oamInterstitial = OAMInterstitial()
 ...
```

## 전면 광고 요청

전면 광고의 `load()`를 요청합니다.

매개변수로는 `placementId`와 `InterstitialCallBackListener`을 받습니다.

[전면광고의 `placementId`는 ONE AdMax 콘솔에서 생성이 가능합니다.](/one-admax-sdk/02..md)

```dart
oamInterstitial.load(
 placementId: interstitialPlacementId,
);
```

{% hint style="warning" %}
과도한 광고 요청은 차단 사유가 되니 주의해주세요!
{% endhint %}

## 전면 광고 이벤트 리스너 설정

전면 광고를 불러올 때 발생하는 이벤트에 대한 리스너를 설정합니다. 제공되는 리스너와 구현 예시는 다음과 같습니다.

```java
_oamInterstitial.load(
  callback: InterstitialCallBackListener(
    onLoaded: onLoaded,
    onLoadFailed: onLoadFailed,
    onOpened: onOpened,
    onOpenFailed: onOpenFailed,
    onClosed: onClosed,
    onClicked: onClicked,
  ),
);
```

{% content-ref url="/pages/i8O1iX5eJtrY4LjZBdFC" %}
[ONE AdMax SDK Error Codes](/one-admax-sdk/oamerror.md)
{% endcontent-ref %}

## 전면 광고 노출

전면 광고를 보여줍니다.

```java
_oamInterstitial.show();
```

## 전면 광고 커스텀 옵션

| 변수                    | 설명                                                      |
| --------------------- | ------------------------------------------------------- |
| backgroundColor       | 배경색 및 투명도 변경. Color 값                                   |
| isHideCloseButton     | 우측 상단 닫기 버튼 노출 여부 설정. default : false                   |
| closeBtnMargin.left   | 닫기 버튼 좌측 마진. default : -28dp                            |
| closeBtnMargin.top    | 닫기 버튼 상단 마진. default : 20dp                             |
| closeBtnMargin.right  | 닫기 버튼 우측 마진. default : 20dp                             |
| closeBtnMargin.bottom | 닫기 버튼 하단 마진. default : 0dp                              |
| isDisableBackButton   | 백키 종료 사용 안 함. deault : false                            |
| EndingText.isShow     | 종료 메시지 노출 여부. default : false                           |
| EndingText.text       | <p>종료 메시지. <br>default : "뒤로 가기를 한 번 더 누르시면 종료됩니다."</p> |
| EndingText.size       | 종료 메시지 size. default : 11sp                             |
| EndingText.color      | 종료 메시지 test color. default : white                      |
| EndingText.align      | 종료 메시지 gravity. default : RIGHT                         |

## 전면 광고 샘플 코드

```java
OAMInterstitial _oamInterstitial = OAMInterstitial()

_oamInterstitial.load(
  placementId: interstitialPlacementId,
  callback: InterstitialCallBackListener(
    onLoaded: onLoaded,
    onLoadFailed: onLoadFailed,
    onOpened: onOpened,
    onOpenFailed: onOpenFailed,
    onClosed: onClosed,
    onClicked: onClicked,
  ),
);

_oamInterstitial.interstitialConfig.isHideCloseButton = false;
_oamInterstitial.interstitialConfig.backgroundColor = Colors.red;
_oamInterstitial.interstitialConfig.endingText = const EndingText(
  'Sample Text',
  12,
  Colors.white,
  TextAlign.center,
  true,
);

_oamInterstitial.interstitialConfig.closeBtnMargin = const CloseBtnMargin(
  top: 10,
  left: 10,
  right: 10,
  bottom: 10,
);

_oamInterstitial.show();
```


---

# 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://one-admax-organization.gitbook.io/one-admax-sdk/05.-flutter-plugin-guide/interstitial.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.
