Skip to main content
Version: 3.0.0

Rewarded

The SDK will handle the incentive video AD loading logic, and the game side can call the display intercalation AD method as needed.

Is Rewarded ad available

public void Button_IsRRewardAdReady()
{

var isRewardReady = HCSDKManager.Instance.IsRewardedAdReady();

if (isRewardReady)
{
HCDebugger.LogDebug("Rewarded ad ready");

}else
{
HCDebugger.LogDebug("Rewarded ad not ready");
}
}


Showing a Rewarded Ad

public void Button_ShowRV()
{
/// <summary>
/// Showing a Rewarded Ad
/// </summary>
/// <param name="_adPos">Rewarded pos</param>
/// <param name="_rewardCallback">Rewarded close callback</param>
/// <param name="_showFailedCallback">Rewarded show fail callback</param>
/// <param name="_useSDKToast">Whether to use SDK pop-up. Enabled by default</param>
/// <param name="_toastContent">SDK pop-up prompt content</param>

bool _useSDKToast = false;
HCSDKManager.Instance.ShowRewardedAd("GetDoubleCoin",RewardCallback,RewardShowFailCallback,_useSDKToast,_toastContent);
}

private void RewardShowFailCallback()
{
// The reward video did not load properly or failed to play
HCDebugger.LogDebug("Failed to play the reward video");
}

private void RewardCallback(bool success)
{
HCDebugger.LogDebug("RewardCallback result:"+success);
if(success)
{
// Issue rewards
}
}

_adPos :Incentive video point name, incentive video advertising point name in [Product Requirements document].You are advised to customize the enumeration according to the required document or download the file to a customized directory.(SDKPositionName.cs)
RewardCallback :Reward video close callback, (in this callback to handle the reward delivery, true: to the user to send a reward, false: incentive failure, can not send a reward)
RewardShowFailCallback :Reward video failed to play callback.
_useSDKToast : SDK Comes with pop-up prompt, enabled by default. The game can be more compatible with the game by using the game cartridge.
_toastContent : SDK pop-up prompts can be displayed in multiple languages.

_adPos enumeration definition example:

For example, the requirements document is as follows

public enum HCRVPositionName
{
RV_RaisePrize,
RV_Offline
}

HCSDKManager.Instance.ShowRewardedAd(HCRVPositionName.RV_RaisePrize.ToString(), (callback)=> { }, null, true,"ads not ready.");