So this is not first time I've used Unity Ads, I've turned on **ADS** from **Services** window. Made an AdsManager class which looks like this:
public class AdsManager : MonoBehaviour
{
public delegate void OnVideoAdFinishListener();
public static event OnVideoAdFinishListener onVideoAdFinishListener;
public void VideoAdFinishListener()
{
if (onVideoAdFinishListener != null)
onVideoAdFinishListener ();
}
public void ShowRewardedAd()
{
print ("Showing Ad");
if (Advertisement.IsReady ("rewardedVideo")) {
var options = new ShowOptions { resultCallback = HandleShowResult };
Advertisement.Show ("rewardedVideo", options);
}
else
{
Debug.Log ("Ad Not ready");
}
}
private void HandleShowResult(ShowResult result)
{
switch (result) {
case ShowResult.Finished:
Debug.Log ("The ad was successfully shown.");
VideoAdFinishListener ();
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;
}
}
Plain and simple. Everything is in place. I have a decent internet connection as well.
But even in editor, it tells me "**Ad not ready**", which is supposed to be the blue colored dummy Ad.
There's no ad on the build as well. I don't know what's going on here. This is the first time I've faced such a problem. Can anyone help me here?
Thank you!
↧