Unity Ads was working great initially but now it seems to be broken.

At first I got Unity ads through the services tab and it was working great. 2 days later, It just stopped working. Advertisement.isready() is always false. It initialises fine with the correct game id and test ad was set to true. I still couldn’t make it work. Going through the internet hasn’t helped either.
I tried to unlink the project in the services tab and then re-link it, checked for any issues with the game id being registered improperly. I tried all solutions provided in the last 2 years.

Advertisement.isReady() is always false in the editor but when I make a build and play it on an android device the test ad plays fine but ShowResult.finished case doesn’t seem to work. It is supposed to reward my player but it doesn’t.

This is really stressing me out. Can anyone help with this issue?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Advertisements;

public class AdManager : MonoBehaviour {

    GameManager gameManager;
    LivesManager lifeManager;

    private void Awake () {
        //Advertisement.Initialize(Advertisement.gameId);
       // Debug.Log(Advertisement.gameId);
      
        if (!Advertisement.isInitialized) {
            Advertisement.Initialize("1513938", true);  //// 1st parameter is String and 2nd is boolean
            Debug.Log("Initialized manually");
        }
    }

    private void Start () {
        gameManager = FindObjectOfType<GameManager>();
        lifeManager = FindObjectOfType<LivesManager>();
    }

  
    public void ShowRewardedAd () {
        Debug.Log(Advertisement.IsReady().ToString());
        if (Advertisement.IsReady("rewardedVideo")) {
            Debug.Log(Advertisement.IsReady().ToString());
            var options = new ShowOptions { resultCallback = HandleShowResult };
            Advertisement.Show("rewardedVideo", options);
        } else if (!Advertisement.IsReady("rewardedVideo")) {          
            gameManager.AdFailed.gameObject.SetActive(true);
            Invoke("DeactivateAdFailUi", 5f);
        }      
    }
 
    private void HandleShowResult (ShowResult result) {
        switch (result) {
        case ShowResult.Finished:
        Debug.Log("The ad was successfully shown.");
        gameManager.deathCount = 2;
        lifeManager.LifeCountManager();
        gameManager.AdOption.gameObject.SetActive(false);
        gameManager.SpawnOptionsActivate();
        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.");
        gameManager.AdFailed.gameObject.SetActive(true);
        Invoke("DeactivateAdFailUi", 5f);
        break;
        }
    }

    void DeactivateAdFailUi() {
        gameManager.AdFailed.gameObject.SetActive(false);
    }
}

It didn’t work for over 24 hours (only in the editor) with me, now it seems to work fine again…

Cheers…

Correct, a release yesterday broke the ability to show the placeholder ads inside editor. It should work again now. Please let us know if you still see problems.

/Rasmus

You are right. Its working great now. But what I time to push that release, the pain it caused, I would rather try out the marines :smile: Thank you very much. You guys were great!