If you like this plugin, please, rate it on Fab. Thank you!
Rewarded ads

Rewarded ads enable users to play games, take surveys, or watch videos to earn in-app rewards, such as coins, extra lives, or points. You can set different rewards for different ad units, and specify the reward values and items the user received.
Prerequisites
Complete the Get Started guide.
Always test with test ads
When building and testing your apps, make sure you use test ads rather than live, production ads. Failure to do so can lead to suspension of your account.
The easiest way to load test ads is to use our dedicated test ad unit ID for rewarded ads:
| Android demo ad unit ID | iOS demo ad unit ID |
|---|---|
| ca-app-pub-3940256099942544/5224354917 | ca-app-pub-3940256099942544/1712485313 |
It's been specially configured to return test ads for every request, and you're free to use it in your own apps while coding, testing, and debugging. Just make sure you replace it with your own ad unit ID before publishing your app.
For more information about how Google Mobile Ads SDK test ads work, see Test Ads.
Load a rewarded ad object
To load a rewarded ad, create an instance of UGoogleAdMobRewardedAd class and call it's Load() method.
Header:
class UGoogleAdMobRewardedAd;
// ...
UPROPERTY()
TObjectPtr<UGoogleAdMobRewardedAd> RewardedAd;
Source:
#include "GoogleAdMobRewardedAd.h"
// ...
RewardedAd = NewObject<UGoogleAdMobRewardedAd>(this);
#if PLATFORM_ANDROID
RewardedAd->Load("ca-app-pub-3940256099942544/5224354917");
#elif PLATFORM_IOS
RewardedAd->Load("ca-app-pub-3940256099942544/1712485313");
#endif

Tip
You can use ad load calls to build up a cache of preloaded ads before you intend to show them, so that ads can be shown with zero latency when needed. Since ads expire after an hour, you should clear this cache and reload with new ads every hour. You can see an example of how it can be implemented in the C++ sample project at the bottom of the page.
Show the ad
When you show a rewarded ad, you will use a OnUserEarnedReward delegate to handle reward events. To show a rewarded ad, use it's Show() method.
RewardedAd->OnUserEarnedReward.AddLambda([](int32 RewardAmount, const FString& RewardType)
{
UE_LOG(LogTemp, Display, TEXT("User earned reward: %d %s"), RewardAmount, *RewardType);
});
if (RewardedAd->IsReady())
{
RewardedAd->Show();
}

Ad events
You can listen for a number of events in the ad's lifecycle, including loading, ad impression and click, as well as show and dismiss events. But for the rewarded ad the most important is OnUserEarnedReward. It is recommended to bind to the delegates before loading the ad.
#include "GoogleAdMobRewardedAd.h"
#include "GoogleAdMobResponseInfo.h"
#include "GoogleAdMobAdError.h"
#include "GoogleAdMobAdValue.h"
// ...
RewardedAd->OnLoaded.AddLambda([](const UGoogleAdMobResponseInfo& ResponseInfo){});
RewardedAd->OnFailedToLoad.AddLambda([](const UGoogleAdMobAdError& LoadAdError, const UGoogleAdMobResponseInfo& ResponseInfo){});
RewardedAd->OnClicked.AddLambda([](){});
RewardedAd->OnImpression.AddLambda([](){});
RewardedAd->OnShown.AddLambda([](){});
RewardedAd->OnFailedToShow.AddLambda([](const UGoogleAdMobAdError& AdError){});
RewardedAd->OnDismissed.AddLambda([](){});
RewardedAd->OnPaidEvent.AddLambda([](const UGoogleAdMobAdValue& AdValue){});
RewardedAd->OnUserEarnedReward.AddLambda([](int32 RewardAmount, const FString& RewardType){});

Validate server-side verification (SSV) callbacks (Optional)
Apps that require extra data in server-side verification callbacks should use the custom data feature of rewarded ads. Any string value set on a rewarded ad object is passed to the custom_data query parameter of the SSV callback. If no custom data value is set, the custom_data query parameter value won't be present in the SSV callback.
#include "GoogleAdMobRewardedAd.h"
// ...
RewardedAd->SetSSVCustomData(TEXT("CUSTOM_DATA_STRING"));

If you want to set the custom reward string, you must do so before showing the ad.
Note
The custom reward string is percent escaped and might require decoding when parsed from the SSV callback.
FAQ
Is there a timeout for the initialization call?
After 10 seconds, Google Mobile Ads SDK invokes the OnInitializationComplete delegate even if a mediation network still hasn't completed initialization.
What if some mediation networks aren't ready when I get the initialization callback?
Google recommends loading an ad inside the bound function of the OnInitializationComplete delegate. Even if a mediation network is not ready, Google Mobile Ads SDK still asks that network for an ad. So if a mediation network finishes initializing after the timeout, it can still service future ad requests in that session.
Does the OnUserEarnedReward delegate always get called before the OnDismissed delegate?
For Google ads, OnUserEarnedReward is broadcast before the OnDismissed delegate. For ads served through mediation, the third-party ad network SDK's implementation determines the broadcast order. For ad network SDKs that provide a single close callback with reward information, the mediation adapter invokes OnUserEarnedReward delegate before OnDismissed.