Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

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

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

  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:
    70
    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:
    102
    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:
    70
    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