Skip to main content

Rewarded Video

Step 1.Prerequisites#

This document mainly introduces how to integrate Rewarded Video Ads :

  • Use Android Studio 3.2 or later
  • minSdkVersion 16 or later
  • compileSdkVersion 28 or later
  • Recommended: Create your TradPlus Apps and get your AppId
  • Initialize the TradPlus SDK for Unity3DAndroid

Step 2.Integration#

2.1 Create an Ad#

//Create adUnitId from your App
TradPlus.LoadRewardedVideoPluginsForAdUnits("AdUnitId");

2.2 Load an Ad#

/**
* @param AdUnitId create adUnit Id from your App
* @param Autostitial Ads show an ad automatically between activities,pass true to set auto load Mode.
*/
TradPlus.RequestRewardedVideo("AdUnitId",true);

2.3 Implement Event Listeners#

MethodDescription
TradPlusManager.OnRewardedVideoAdLoadedV6.4.5 new API. After requesting an ad, it will only call back once if the ad source is successfully cached and not displayed.
TradPlusManager.OnRewardedVideoAdFailedV6.4.5 new API. After requesting an ad, a callback will be made only if all ad source requests failed. That is, set up multiple ad source caches, and call back when all ad sources fail to load
TradPlusManager.OnRewardedVideoAdImpressionCalled when a rewarded ad is clicked.The old version API is 'OnRewardedVideoShownEvent'
TradPlusManager.OnRewardedVideoAdClickedCalled when a rewarded ad starts playing.The old version API is 'OnRewardedVideoClickedEvent'
TradPlusManager.OnRewardedVideoAdClosedCalled when a rewarded ad is closed..The old version API is 'OnRewardedVideoDismissedEvent'
TradPlusManager.OnRewardedVideoAdRewardCalled when a rewarded ad is completed and the user should be rewarded.The old version API is 'OnRewardedVideoReceivedRewardEvent'
TradPlusManager.OnRewardedVideoAdVideoErrorV6.4.5 new API. Called when the ad fails to show for the given adUnitId.
TradPlusManager.OnRewardedVideoAdAllLoadedCalled when a rewarded ad is completed loading.Can be used to determine whether there are available ads, 'true' indicates that there are available ads, and 'false' indicates that there are no available ads.
TradPlusManager.OneRewardedVideoLayerLoadFailedAfter requesting an ad, each ad source will be called back once it fails to load. That is, set up multiple ad source caches, and a callback will be made when each ad source fails to load.The old version API is 'OnRewardedVideoFailedEvent'.
TradPlusManager.OneRewardedVideoLayerLoadedAfter requesting an ad, each ad source will be called back once it successes to load. That is, set up multiple ad source caches, and a callback will be made when each ad source successes to load.The old version API is 'OnRewardedVideoLoadedEvent'.
TradPlusManager.OnRewardedVideoLoadAdStartV6.4.5 new API. Called when a rewarded ad starts loading.
TradPlusManager.OnRewardedVideoBiddingStartV6.4.5 new API. Called when a rewarded ad starts bidding.
TradPlusManager.OnRewardedVideoBiddingEndV6.4.5 new API. Called when a rewarded ad is completed bidding.

2.4 Set the SceneId#

TradPlus.RewardedVideoEntryAdScenario("AdUnitId");
TradPlus.RewardedVideoEntryAdScenario("AdUnitId","sceneId");

Learn more about SceneId

You can create SceneId , as shown below :

You can get SceneId , as shown below :

2.5 Show an Ad#

//AutoLoad is set to true, ads will be displayed directly if there are ads, ads will be automatically loaded if there are no ads
//If you choose to call SceneId when entering the interface where the ad slot is located,
//you must pass in the SceneId while showing the ad,
//otherwise you only need to pass in the AdUnitId as a parameter
TradPlus.ShowRewardedVideo("AdUnitId","sceneId");

2.6 Check is Ready#

//if you use AutoLoad Mode,when HasRewardedVideo() == false will reload the ad
TradPlus.HasRewardedVideo("AdUnitId");

Step 3.Note#

(1)AdUnitId#

(2)When you reload an ad#

- if you don't use AutoLoad Mode:
- Reload the ad after `OnRewardedVideoAllLoadedEvent` isLoadedSucces == false
- Reload the ad after `OnRewardedVideoDismissedEvent` and `HasRewardedVideo()` == false