> ## Documentation Index
> Fetch the complete documentation index at: https://guide.daro.so/llms.txt
> Use this file to discover all available pages before exploring further.

# 인터스티셜 광고

## 인터스티셜 광고 형태 소개

* 화면 전체를 덮는 형태로 노출되는 광고입니다.
* 이미지/동영상 모두 포함되나 동영상 소재가 더 많이 노출되며 일반적으로 5초 후부터 스킵이 가능합니다.

<img src="https://mintcdn.com/delightroom-5a71a6a8/dxU0bpsPoPvkYh_g/sdk-integration/common-img/ad-formats/interstitial-example-image.png?fit=max&auto=format&n=dxU0bpsPoPvkYh_g&q=85&s=fa0468f45283f40d5937e24afde61f88" alt="Interstitial Example Image Pn" title="Interstitial Example Image Pn" style={{ width:"38%" }} width="1080" height="2336" data-path="sdk-integration/common-img/ad-formats/interstitial-example-image.png" />

### 동작 예시

<img src="https://mintcdn.com/delightroom-5a71a6a8/dxU0bpsPoPvkYh_g/sdk-integration/common-img/ad-formats/interstitial-example-gif-kor.gif?s=7acbabb11ba699d443e6df486522954f" alt="Interstitial Example Gif Kor Gi" title="Interstitial Example Gif Kor Gi" style={{ width:"38%" }} width="240" height="518" data-path="sdk-integration/common-img/ad-formats/interstitial-example-gif-kor.gif" />

***

## 구현하기

인터스티셜 광고는 Hook API로 사용합니다. 컴포넌트 내부에서 `useInterstitialAd`를 사용하면 로딩 상태와 이벤트 콜백을 함께 관리할 수 있습니다.

<Warning>
  기존의 정적 API(`InterstitialAd.loadAd` 등)는 deprecated입니다. 정적 리스너(`InterstitialAd.addAdLoadedEventListener` 등)는 Hook이나 인스턴스 API로 로드한 광고의 이벤트를 받지 못하니, 광고 로드를 새 API로 옮길 때 이벤트 리스너도 함께 옮겨주세요.
</Warning>

```javascript theme={null}
import { Button } from "react-native";
import { useInterstitialAd } from "react-native-daro";

function InterstitialAdButton({ adUnitId }) {
  const { isLoaded, isLoading, load, show, isAdReady } = useInterstitialAd(
    adUnitId,
    {
      onLoaded: (adInfo) => {
        // 광고 로드 성공
      },
      onLoadFailed: (errorInfo) => {
        // 광고 로드 실패
      },
      onDisplayed: (adInfo) => {
        // 광고 노출
      },
      onHidden: (adInfo) => {
        // 광고 닫힘
      },
      onImpressionRecorded: (adInfo) => {
        // 광고 impression 기록
      },
    }
  );

  const handlePress = async () => {
    if (await isAdReady()) {
      show();
      return;
    }

    load();
  };

  return (
    <Button
      disabled={isLoading}
      title={isLoaded ? "Show Interstitial" : "Load Interstitial"}
      onPress={handlePress}
    />
  );
}
```
