Hi,
I have implemented some code that I found in a different thread:
public static void ShowRewardedAd ()
{
string zoneID = "rewardedVideoZone";
// If the value of zoneID is an empty string, set the value to null.
// The default zone is used when the value of zoneID is null.
if (string.IsNullOrEmpty(zoneID)) zoneID = null;
ShowOptions options = new ShowOptions();
options.pause = true; // Pauses game while ads are shown
options.resultCallback = HandleShowResult; // Triggered when the ad is closed
Advertisement.Show(zoneID,options);
}
public static void HandleShowResult (ShowResult result)
{
switch (result)
{
case ShowResult.Finished:
// Add code here to rewarding players for watching ads without skipping.
// Note: This will be the same result for picture ads when shown.
Debug.Log("The ad was successfully shown.");
break;
case ShowResult.Skipped:
Debug.Log("The ad was skipped before reaching the end.");
break;
case ShowResult.Failed:
Debug.LogError("The ad failed to be shown.");
break;
}
}
Even though I have testmode set to true, sometimes the ad fails to load. There is no apparent reason or pattern to this, it just sometimes works and sometimes doesn’t.
Is this a known issue? My concern is that the same issue will occur when I do not have testmode set to true, since I don’t understand why there could be anything stopping the placeholder ad from loading which leads me to believe it could be some fault in the code. Although it seems watertight to me.
Thanks in advance.