error CS0117: 'Advertisement' does not contain a definition for 'IsReady' Problem

I am getting the error ‘Advertisement’ does not contain a definition for ‘IsReady’ how can I fix this?

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

public class BannerAdScript : MonoBehaviour {

    public string gameId = "1234567"; //I don't want to give my id number
    public string placementId = "bannerPlacement";
    public bool testMode = true;

    void Start () {
        Advertisement.Initialize (gameId, testMode);
        StartCoroutine (ShowBannerWhenReady ());
    }

    IEnumerator ShowBannerWhenReady () {
        while (!Advertisement. IsReady(placementId)) {
            yield return new WaitForSeconds (0.5f);
        }
        Advertisement.Banner.Show (placementId);
    }
}

If you use Advertisement 4.0.0 then it seems to be deprecated or aobsolete like written here https://docs.unity.com/ads/DeprecatedAPIClasses.htm. If not then maybe you can provide more information about your setup.
Greetings.

2 Likes