Rewarded Video

Integrate rewarded video ads

Usage

The integration steps for rewarded videos are very similar like for other fullscreen ads. You will just need to use createPlacement with AATKitBinding.PlacementSize.Rewarded parameter. If you’ve used rewarded videos before with the normal fullscreen placement, please make sure to use a different placement name for your new rewarded video placement. When the user watches the rewarded video and incentive is earned, the onUserEarnedIncentive event is triggered. See the example of using rewarded video ads below.

public class YourAdsManager : MonoBehaviour {

...

    public void InitializeAATKit()
    {
        //Register delegates
        AATKitBinding.OnHaveAdDelegate += OnHaveAd;
        AATKitBinding.OnUserEarnedIncentiveDelegate += OnUserEarnedIncentive;
        //Initialize AATKit
        ...
    }

    public void CreateRewarded() 
    {
        AATKitBinding.CreatePlacement("YourPlacementName", AATKitBinding.PlacementSize.Rewarded);
        AATKitBinding.StartPlacementAutoReload("YourPlacementName");
    }

    public ShowRewardedAd() 
    {
        if (AATKitBinding.HasAdForPlacement("YourPlacementName"))
        {
            AATKitBinding.ShowPlacement("YourPlacementName");
        }
    }

    public void OnHaveAd(string placementName) 
    {
        Debug.Log("onHaveAd event: " + placementName);

        if(placementName.Equals("YourPlacementName")) 
        {
            Debug.Log("OnHaveAd for YourPlacementName");
        }
    }

    public void OnUserEarnedIncentive(IncentiveData incentiveData) 
    {
        Debug.Log("OnUserEarnedIncentive event: " + incentiveData.ToString());
    }
}

Last updated