Search Unity

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

Discussion in 'Unity Ads & User Acquisition' started by bayeggex, Dec 17, 2021.

Thread Status:
Not open for further replies.
  1. bayeggex

    bayeggex

    Joined:
    Apr 21, 2021
    Posts:
    1
    I am getting the error 'Advertisement' does not contain a definition for 'IsReady' how can I fix this?

    Code (CSharp):
    1. using System.Collections;
    2. using UnityEngine;
    3. using UnityEngine.Advertisements;
    4.  
    5. public class BannerAdScript : MonoBehaviour {
    6.  
    7.     public string gameId = "1234567"; //I don't want to give my id number
    8.     public string placementId = "bannerPlacement";
    9.     public bool testMode = true;
    10.  
    11.     void Start () {
    12.         Advertisement.Initialize (gameId, testMode);
    13.         StartCoroutine (ShowBannerWhenReady ());
    14.     }
    15.  
    16.     IEnumerator ShowBannerWhenReady () {
    17.         while (!Advertisement. IsReady(placementId)) {
    18.             yield return new WaitForSeconds (0.5f);
    19.         }
    20.         Advertisement.Banner.Show (placementId);
    21.     }
    22. }
     
  2. D12294

    D12294

    Joined:
    Oct 6, 2020
    Posts:
    81
    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.
     
    bayeggex and Unity_Quinn like this.
Thread Status:
Not open for further replies.