Hi All,
So I’m having problems trying to figure out how to reward the player after watching the entire, not skipping, reward video ad from AdMob. I don’t know if there is a specific function that I can call that contains different cases like Unity Ads or what exactly I have to do to accomplish this.
Here is what I am using now:
public void AmShowRewardVideo ()
{
//Admob
if (Admob.Instance ().isRewardedVideoReady())
{
Admob.Instance ().showRewardedVideo ();
DataManagement.datamanagement.totalCoins += 100;
}
//UnityAds
else if (Advertisement.IsReady("rewardedVideo"))
{
var options = new ShowOptions { resultCallback = HandleShowResult };
Advertisement.Show("rewardedVideo", options);
}
DataManagement.datamanagement.SaveData ();
}
//Unity Ads Reward Video Result
private void HandleShowResult(ShowResult result) //Would need something similar to this for the AdMob video to solve my issue
{
switch (result)
{
case ShowResult.Finished:
Debug.Log ("Unity reward ad shown");
DataManagement.datamanagement.totalCoins += 100;
break;
case ShowResult.Skipped:
Debug.Log("Unity reward ad skipped");
break;
case ShowResult.Failed:
Debug.Log("Unity reward ad failed");
break;
}
DataManagement.datamanagement.SaveData ();
}
In case it can’t supply an AdMob video, it shows a Unity ads video (I believe). The Unity Ads HandleShowResualt function is exactly what I need to be doing for my AdMob video. How can I do this?