Search Unity

unity advertisement is not working in editor, isReady() always returns false

Discussion in 'Unity Ads & User Acquisition' started by jerryhou0129, Oct 7, 2019.

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

    jerryhou0129

    Joined:
    Oct 1, 2018
    Posts:
    4
    using System.Collections;
    using UnityEngine;
    using UnityEngine.Advertisements;

    public class AdController : MonoBehaviour
    {

    public string gameId = "1234567";
    public string placementId = "testad";
    public bool testMode = true;

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

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

    I am sure that placementID is linked, and the placementState is always "not available"
    I have imported the package from asset store, and removed the original package from package manager
    Any suggestions?
     
  2. glenhunter

    glenhunter

    Unity Technologies

    Joined:
    Apr 2, 2019
    Posts:
    92
    public string gameId = "1234567"; is that the gameid you're using? Are you seeing test banners appear within the editor?
     
    PicusB likes this.
  3. jerryhou0129

    jerryhou0129

    Joined:
    Oct 1, 2018
    Posts:
    4
    Does the gameId really matter as the testMode is set to true? test banners did not appear within the editor
     
  4. segant

    segant

    Joined:
    May 3, 2017
    Posts:
    196
    It does
     
  5. jerryhou0129

    jerryhou0129

    Joined:
    Oct 1, 2018
    Posts:
    4
    To be honested, this is the simplified version of code.
    I have put the correct apple store id and google play id, and it hasn't worked
     
  6. glenhunter

    glenhunter

    Unity Technologies

    Joined:
    Apr 2, 2019
    Posts:
    92
    Would you be able to send an email to unityads-support@unity3d.com - from here we'll be able to do a more in-depth investigation.
     
  7. jerryhou0129

    jerryhou0129

    Joined:
    Oct 1, 2018
    Posts:
    4
    By the way, other types of advertisement are working, except this banner ad
     
  8. Pie556

    Pie556

    Joined:
    Aug 30, 2021
    Posts:
    1
    i know this is a old thread but my problem is that when I type Advertisements.isReady() it says Advertisements does not contain a definition for isReady
     
  9. Unity_Quinn

    Unity_Quinn

    Unity Technologies

    Joined:
    Nov 6, 2020
    Posts:
    102
Thread Status:
Not open for further replies.