Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Unity Ads won't show on Android Device anymore

Discussion in 'Unity Ads & User Acquisition' started by bsmith, Jul 17, 2015.

  1. bsmith

    bsmith

    Joined:
    Oct 26, 2014
    Posts:
    9
    I have checked, rechecked, and have searched endlessly on trying to figure out why Unity Ads will show in the editor and not on a Android device (Currently the HTC M8).

    What is most frustrating is that originally did have Ads working but has recently stopped working on Android devices.
    Code (CSharp):
    1.  
    2.        
    3.         void Awake ()
    4.         {
    5.         Advertisement.Initialize ("55409",true);
    6.         }
    7.        
    8.         IEnumerator ShowAdWhenReady()
    9.         {
    10.             while (!Advertisement.IsReady())
    11.                 yield return null;
    12.            
    13.             Advertisement.Show ();
    14.         }
    15.     void Update(){
    16.  
    17.         if (counterForAds < 1)
    18.         {
    19.             StartCoroutine(ShowAdWhenReady());
    20.             ResetCounter();
    21.         }
    22.     }
    23.  
    24.     public const int counterReset = 3;
    25.     public static int counterForAds = counterReset;
    26.  
    27.     void ResetCounter()
    28.     {
    29.         counterForAds = counterReset;
    30.     }
    31.  
     
  2. Rasmus Selsmark

    Rasmus Selsmark

    Joined:
    Mar 13, 2013
    Posts:
    120
  3. bsmith

    bsmith

    Joined:
    Oct 26, 2014
    Posts:
    9
    I re-imported Unity Ads and it seems to be working now.