ShowRewardedVideo

Description

Display a rewarded video ad if available.

Declaration

public static void ShowRewardedVideo(UnityAction<bool> completeMethod)

Parameters

NameDescription

completeMethod

The callback is called when the rewarded video is closed. Use it to reward the user after the ad view.

Example

public class Test : MonoBehaviour
{
    private void Start()
    {
        Gley.MobileAds.API.Initialize();
    }
    
    public void ShowRewardedVideo()
    {
        Gley.MobileAds.API.ShowRewardedVideo(VideoComplete);
    }

    private void VideoComplete(bool watched)
    {
        if(watched)
        {
            //reward the user
        }
        else
        {
            //video skipped - don't give the reward
        }
    }
}

Last updated