title: Unity AdMob ads not displayed
body: <p>I'm making a game on Unity 5.5 and I've followed <a href="https://firebase.google.com/docs/admob/unity/start" rel="nofollow noreferrer" title="Google&#39;s Official AdMob Getting Started Guide">Google's Official AdMob Getting Started Guide</a> to integrate AdMob into my game (currently iOS-only, but Android will also follow when I get this working).</p>
  
  <ul>
  <li>I've set up my game at the AdMob console and created a reward-based video ad.</li>
  <li>I've added the <code>GoogleMobileAds.framework</code> into my built project in Xcode.</li>
  <li>I've made sure I'm linking against the newly-added framework too.</li>
  <li>Downloaded the Unity package and integrated it into my project as required.</li>
  <li>I've hooked up to event handlers: My ad gets loaded with no problem, no failure.</li>
  </ul>
  
  <p>When I try to display the ad on iOS, <code>ad.IsLoaded();</code> returns false even though it has just loaded (my <code>OnAdLoaded</code> event of the ad is firing). In Unity editor, I'm seeing the expected dummy methods being called at correct order (though nothing is being displayed, which I think is the expected behavior on Unity's own editor).</p>
  
  <p>Here is my code for loading ads (of course, my publisher and ad unit IDs are redacted):</p>
  
  <pre><code>public class AdManager : MonoBehaviour {
  
      static RewardBasedVideoAd ad;
      static UIManager uiManager;
  
      #if UNITY_ANDROID
      static string adUnitId = "ca-app-pub-XXX/YYY";
      #elif UNITY_IPHONE
      static string adUnitId = "ca-app-pub-XXX/YYY";
      #else
      static string adUnitId = "unexpected_platform";
      #endif
  
      static int headstartPoints;
  
  
      // Use this for initialization
      void Start () {
          uiManager = GameObject.Find("Scripts").GetComponent&lt;UIManager&gt;();
          ad = RewardBasedVideoAd.Instance;
          ad.OnAdRewarded += Ad_OnAdRewarded;
          ad.OnAdClosed += Ad_OnAdClosed;
          ad.OnAdFailedToLoad += Ad_OnAdFailedToLoad;
          ad.OnAdLoaded += Ad_OnAdLoaded;
          headstartPoints = 0;
          RequestNewAd();
      }
  
      void Ad_OnAdFailedToLoad (object sender, AdFailedToLoadEventArgs e)
      {
          Debug.Log("Ad failed to load.");
      }
  
      void Ad_OnAdLoaded (object sender, System.EventArgs e)
      {
          Debug.Log("Ad loaded.");
      }
  
      void Ad_OnAdClosed (object sender, System.EventArgs e)
      {
          Debug.Log("Ad was closed, proceeding to game without rewards...");
      }
  
      void Ad_OnAdRewarded (object sender, Reward e)
      {
          Debug.Log("Ad rewarded.");
          headstartPoints = (int)e.Amount;
      }
  
      public static int GetAndConsumeRewards(){
          int points = headstartPoints;
          headstartPoints = 0;
          return points;
      }
  
      public static void RequestNewAd(){
          Debug.Log("Requested new ad.");
          AdRequest request = new AdRequest.Builder().Build();
          ad.LoadAd(request, adUnitId);
      }
  
      public static void DisplayAdOrProceed(){
          if(ad.IsLoaded()){
              ad.Show();
              Debug.Log("Ad was loaded, displaying ad...");
          }else{
              Debug.Log("Ad wasn't loaded, skipping ad...");
              uiManager.ProceedToGame();
          }
      }
  
      // Update is called once per frame
      void Update () {
  
      }
  }
  </code></pre>
  
  <p>I've never seen <code>OnAdFailedToLoad</code> method being called, and I always see <code>OnAdLoaded</code> being called, so there doesn't seem to be a problem there. But when I check <code>ad.IsLoaded()</code> <em>after</em> ad is loaded, for some weird reason it's false. Please note that <code>RewardBasedVideoAd</code> is a singleton object as stated in Google's docs.</p>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>UPDATE:</strong> I am calling <code>RequestNewAd()</code> as soon as the app starts and also on each "level" start (think of it like one level is roughly ~30 seconds) and <code>DisplayAdOrProceed()</code> on death (e.g. end of the level). When <code>DisplayAdOrProceed()</code> is called, the ad's loaded method is always called (unless I have a connection problem but that's not the case here).</p>
  
  <p><strong>UPDATE 2:</strong> Just noticed that there is a really suspicious stack trace on "ad load" event:</p>
  
  <pre><code>Ad loaded.
  UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
  UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
  UnityEngine.Logger:Log(LogType, Object)
  UnityEngine.Debug:Log(Object)
  AdManager:Ad_OnAdLoaded(Object, EventArgs)
  System.EventHandler`1:Invoke(Object, TEventArgs)
  GoogleMobileAds.Api.RewardBasedVideoAd:&lt;RewardBasedVideoAd&gt;m__8(Object, AdFailedToLoadEventArgs)
  System.EventHandler`1:Invoke(Object, TEventArgs)
  GoogleMobileAds.iOS.RewardBasedVideoAdClient:RewardBasedVideoAdDidFailToReceiveAdWithErrorCallback(IntPtr, String)
  </code></pre>
  
  <p>I can see that the ad load event is fired from a method named for a failure handler (<code>RewardBasedVideoAdDidFailToReceiveAdWithErrorCallback</code>, <code>GoogleMobileAds.Api.RewardBasedVideoAd:&lt;RewardBasedVideoAd&gt;m__8(Object, AdFailedToLoadEventArgs)</code>). However, it's calling the ad load event and not any failure handler. I have no idea what's going on or if it's a poorly-designed naming convention or not.</p>