Rewarded ads let you offer users in-app items—such as continued gameplay, virtual currency, or other rewards—in exchange for their engagement with ads. Rewarded ads boost engagement because users receive a tangible benefit for their time.
The following sections show you how to load and then show a rewarded ad.
The following code shows you how to bind to delegates and load the first rewarded ad:

// 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 RewardedAdUnitId = TEXT("«ad-unit-ID»");
int RetryAttempt = 0;
FTimerHandle LoadTimerHandle;
void UMyWidget::InitializeRewardedAds(){
// Bind member functions to delegates
UAppLovinMAX::OnRewardedAdLoadedDelegate.AddUObject(this, &UMyWidget::OnRewardedAdLoaded);
UAppLovinMAX::OnRewardedAdLoadFailedDelegate.AddUObject(this, &UMyWidget::OnRewardedAdLoadFailed);
UAppLovinMAX::OnRewardedAdDisplayFailedDelegate.AddUObject(this, &UMyWidget::OnRewardedAdDisplayFailed);
UAppLovinMAX::OnRewardedAdHiddenDelegate.AddUObject(this, &UMyWidget::OnRewardedAdHidden);
UAppLovinMAX::OnRewardedAdReceivedRewardDelegate.AddUObject(this, &UMyWidget::OnRewardedAdReceivedReward);
// Load first rewarded ad
LoadRewardedAd();
}
void UMyWidget::LoadRewardedAd(){
UAppLovinMAX::LoadRewardedAd(RewardedAdUnitId);
}
void UMyWidget::OnRewardedAdLoaded(const FAdInfo &AdInfo){
// Rewarded ad is ready to be shown. UAppLovinMAX::IsRewardedAdReady(RewardedAdUnitId) will now return 'true'
// Reset retry attempt
RetryAttempt = 0;
}
void UMyWidget::OnRewardedAdLoadFailed(const FAdInfo &AdInfo, const FAdError &AdError){
// Rewarded 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::LoadRewardedAd, RetryDelay, false);
});
}
void UMyWidget::OnRewardedAdDisplayFailed(const FAdInfo &AdInfo, const FAdError &AdError){
// Rewarded ad failed to display. AppLovin recommends that you load the next ad.
LoadRewardedAd();
}
void UMyWidget::OnRewardedAdHidden(const FAdInfo &AdInfo){
// Rewarded ad is hidden. Pre-load the next ad.
LoadRewardedAd();
}
void UMyWidget::OnRewardedAdReceivedReward(const FAdInfo &AdInfo, const FAdReward &Reward){
// Rewarded ad was displayed and user should receive the reward
}To show a rewarded ad, call ShowRewardedAd():

if (UAppLovinMAX::IsRewardedAdReady(RewardedAdUnitId))
{
UAppLovinMAX::ShowRewardedAd(RewardedAdUnitId);
}You can receive callbacks to your currency server. To learn how, see the MAX S2S rewarded callback API guide. Then update the Server Side Callback URL in your Edit Ad Unit page.
To set the reward amount and currency:

