Search Unity

Unity Ads never display (Ad's are never ready after initialization?

Discussion in 'Unity Ads & User Acquisition' started by FlamingJampack, Oct 28, 2018.

  1. FlamingJampack

    FlamingJampack

    Joined:
    Mar 30, 2017
    Posts:
    1
    I have been having this issue for weeks now and it has really put me behind schedule on the release of my app. For months now I have tried alternatives for banner ads and even tried resorting to change how I use advertisements. Until tonight when the new update came out for Unity Ads to allow banners, i was so excited! I tried again to setup banners and now I'm tired that it never works. Now I am testing this on the editor and want to only test on the editor. I will not run the app on a phone until after i know it works on the editor, so please do not offer me to use a phone. Secondly, I tried making a blank project with the same code and the difference with the blank project and this one is that this one says that it is being initialized but the blank project says nothing. I suspect the reason for this might be because of now correctly connecting it to my unity account, i dont know, it's 1:30am lol. Finally here are images of my issue and the code being used.


    Code (CSharp):
    1. using System.Collections;
    2. using UnityEngine;
    3. using UnityEngine.Advertisements;
    4.  
    5. public class BannerAds : MonoBehaviour {
    6.  
    7.     public string bannerPlacement = "banner";
    8.     public bool testMode = false;
    9.  
    10. #if UNITY_IOS
    11.     public const string gameID = "my iphone game id";
    12. #elif UNITY_ANDROID
    13.     public const string gameID = "my android game id";
    14. #elif UNITY_EDITOR
    15.     public const string gameID = "I leave this blank";
    16. #endif
    17.  
    18.     void Start () {
    19.         Advertisement.Initialize (gameID, testMode);
    20.         Debug.Log("Initialized");
    21.         StartCoroutine (ShowBannerWhenReady ());
    22.     }
    23.  
    24.     IEnumerator ShowBannerWhenReady () {
    25.         while (!Advertisement.IsReady ("banner")) {
    26.             yield return new WaitForSeconds (1f);
    27.                         Debug.Log("dummy");
    28.         }
    29.         Advertisement.Banner.Show (bannerPlacement);
    30.                 Debug.Log("smarty");
    31.     }
    32. }
    Now here is a screenshot of the result:


    So as you can see it is clearly displaying that the unityad has initialzied in the editor and displays my gameID and that i am on testmode. After confirming initialization it should say dummy maybe once or a few times, benefit on the doubt. But leaving this to run for 5 minutes, it never loads. Someone got an idea or know why? there are not enough people with this issue so i might think this will be a basis for most. :(
     

    Attached Files:

  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,161
  3. RaulDoesNothing

    RaulDoesNothing

    Joined:
    Oct 28, 2018
    Posts:
    5
    Ok so this is me again. I do not know what the problem was but I made a solution.
    I just made a new unity account to start clean with this project since this project has had many name changes and such because I was less experienced in this. So I made a new account and linked the local project to my new account. It was an automatic fix when I tested my code. I was ecstatic!!!