Rewarded Ad
1. Basic requirements
Add ADX Unity SDK to your project.
Use the Ad Unit ID issued for Banner Ads.
Before requesting an ad, SDK initialization must be done first.
SDK initialization should be called only once when the app launches and ad requests should be made after SDK initialization is complete.
2. Implementation
If the app is distributed on both Android and iOS, enter the Ad Unit ID issued for each platform.
Instantiate
AdxRewardedAdand register the required callbacks.Call
Load()to load the ad.When disposing of the ad object, call
Destroy().
#if UNITY_ANDROID
string adxRewardedAdUnitId = "<ANDROID_ADX_REWARDED_AD_UNIT_ID>";
#elif UNITY_IOS
string adxRewardedAdUnitId = "<IOS_ADX_REWARDED_AD_UNIT_ID>";
#endif
void LoadRewardedAd()
{
if (rewardedAd == null)
{
rewardedAd = new AdxRewardedAd(adxRewardedAdUnitId);
rewardedAd.OnRewardedAdLoaded += RewardedAd_OnRewardedAdLoaded;
rewardedAd.OnRewardedAdFailedToLoad += RewardedAd_OnRewardedAdFailedToLoad;
rewardedAd.OnRewardedAdShown += RewardedAd_OnRewardedAdShown;
rewardedAd.OnRewardedAdClicked += RewardedAd_OnRewardedAdClicked;
rewardedAd.OnRewardedAdFailedToShow += RewardedAd_OnRewardedAdFailedToShow;
rewardedAd.OnRewardedAdEarnedReward += RewardedAd_OnRewardedAdEarnedReward;
rewardedAd.OnRewardedAdClosed += RewardedAd_OnRewardedAdClosed;
}
rewardedAd.Load();
}Check whether an ad is available using
IsLoaded(), and if so, display the ad withShow().
When disposing of the ad object, call
Destroy()
3. Callback
You can receive specific events. Please implement them as needed.
4. Ad Revenue (OnPaidEvent)
You can check the estimated ad revenue for ad impressions.
5. SSV (Server-side verification) Settings
SSV settings are optional and can be configured only if needed.
SSV allows the reward event to trigger a server-to-server callback via the Callback URL.
The conditions for using SSV are as follows:
A
Rewarded Videotype with a registered Callback URL must be configured in the dashboard.A reward event must occur after the user has fully watched the video.
If necessary, set the
User IDorCustom Datainformation via the SDK before requesting an ad.
If the client sets the
User IDandCustom Data, they will be included in the Callback URL request.Example: https://callback_url?param=value&userid=<value>&customdata=<value>
SSV settings must be configured before the ad request to ensure the Callback URL includes the data.
Refer to the server-side SSV callback verification guide to verify the reward.
Last updated
Was this helpful?