interstitial ads는 앱의 인터페이스를 일시적으로 가리는 전체 화면 또는 전체 페이지 광고입니다. 일반적으로 게임에서 레벨을 완료한 후나 주요 뷰 사이를 탐색할 때와 같이 자연스러운 일시 중지 또는 전환 시점에 표시됩니다.
다음 섹션에서는 interstitial ad를 로드한 다음 보여주는 방법을 설명합니다.
다음 코드는 델리게이트에 바인딩하고 첫 번째 interstitial을 로드하는 방법을 보여줍니다.

// UMyWidget.cpp (UMyWidget inherits from UObject to access TimerManager)
#include "UMyWidget.h"
#include "AppLovinMAX.h"
// For retry timer logic
#include "Async/Async.h"
#include "Engine/World.h"
#include "TimerManager.h"
const FString InterstitialAdUnitId = TEXT("«ad-unit-ID»");
int RetryAttempt = 0;
FTimerHandle LoadTimerHandle;
void UMyWidget::InitializeInterstitialAds()
{
// Bind member functions to delegates
UAppLovinMAX::OnInterstitialAdLoadedDelegate.AddUObject(this, &UMyWidget::OnInterstitialAdLoaded);
UAppLovinMAX::OnInterstitialAdLoadFailedDelegate.AddUObject(this, &UMyWidget::OnInterstitialAdLoadFailed);
UAppLovinMAX::OnInterstitialAdDisplayFailedDelegate.AddUObject(this, &UMyWidget::OnInterstitialAdDisplayFailed);
UAppLovinMAX::OnInterstitialAdHiddenDelegate.AddUObject(this, &UMyWidget::OnInterstitialAdHidden);
// Load first interstitial
LoadInterstitial();
}
void UMyWidget::LoadInterstitial()
{
UAppLovinMAX::LoadInterstitial(InterstitialAdUnitId);
}
void UMyWidget::OnInterstitialAdLoaded(const FAdInfo &AdInfo)
{
// Interstitial ad is ready to be shown. UAppLovinMAX::IsInterstitialReady(InterstitialAdUnitId) will now return 'true'
// Reset retry attempt
RetryAttempt = 0;
}
void UMyWidget::OnInterstitialAdLoadFailed(const FAdInfo &AdInfo, const FAdError &AdError)
{
// Interstitial ad failed to load
// AppLovin recommends that you retry with exponentially higher delays, up to a maximum delay (in this case 64 seconds)
RetryAttempt++;
AsyncTask(ENamedThreads::GameThread, [this]() {
float RetryDelay = FMath::Pow(2.0f, FMath::Min(6, RetryAttempt));
GetWorld()->GetTimerManager().SetTimer(LoadTimerHandle, this, &UMyWidget::LoadInterstitial, RetryDelay, false);
});
}
void UMyWidget::OnInterstitialAdDisplayFailed(const FAdInfo &AdInfo, const FAdError &AdError)
{
// Interstitial ad failed to display. AppLovin recommends that you load the next ad.
LoadInterstitial();
}
void UMyWidget::OnInterstitialAdHidden(const FAdInfo &AdInfo)
{
// Interstitial ad is hidden. Pre-load the next ad.
LoadInterstitial();
}
권장 사항: interstitial ads 표시하기
interstitial ad를 표시하려면 ShowInterstitial()을 호출합니다.

if (UAppLovinMAX::IsInterstitialReady(InterstitialAdUnitId))
{
UAppLovinMAX::ShowInterstitial(InterstitialAdUnitId);
}