Search Unity

cannot get test banner ad to show up

Discussion in 'Unity Ads & User Acquisition' started by rustyruss1985, Dec 26, 2019.

  1. rustyruss1985

    rustyruss1985

    Joined:
    Sep 5, 2017
    Posts:
    2
    also posted on unityanswers: https://answers.unity.com/questions/1687143/test-ad-not-working.html

    Hello, i'm trying to display a simple banner ad at the bottom of my app. i'm using the below script (Taken directly from unity's website)
    Code (CSharp):
    1. using System.Collections;
    2. using UnityEngine;
    3. using UnityEngine.Advertisements;
    4.  
    5.  
    6.  
    7. public class  BannerAd : MonoBehaviour
    8. {
    9.  
    10.     public string gameId = "xxxx381";
    11.     public string placementId = "id";
    12.     public bool testMode = true;
    13.  
    14.     void Start()
    15.     {
    16.         Advertisement.Initialize(gameId, testMode);
    17.  
    18.         StartCoroutine(ShowBannerWhenReady());
    19.         Debug.Log("banner ad coroutine started");
    20.     }
    21.  
    22.     IEnumerator ShowBannerWhenReady()
    23.     {
    24.         Debug.Log("in banner ad coroutine");
    25.         while (!Advertisement.IsReady(placementId))
    26.         {
    27.             yield return new WaitForSeconds(0.5f);
    28.         }
    29.         Debug.Log("showing banner ad");
    30.         Advertisement.Banner.Show(placementId);
    31.     }
    32. }
    i've ensured gameId matches the one on my console, and i have created an ad placement on my console. ads are enabled in my editor services.

    it gets to the Debug.Log("in banner ad coroutine"), but the ad never becomes ready (loops forever).

    anyone know what could be causing the ad to never become ready?

    (these are just test ads, i haven't even tried publishing it yet and showing real ads)..i did try building a debug version to my device, but same thing (no ads ever shown).


    thanks
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519