title: Interstitial iAD: How to detect closing on iOS 8?
body: <p>We show interstitial iAds between levels. Since iAds appear to require quite a bit of memory (we used to receive many memory warnings when they are shown and experienced some crashes), we do not load the new view before the interstitial has been closed (so, we first unload the game view, then we show the interstitial, then we load the game view).</p>
  
  <p>For this, we used the old/deprecated way of showing interstitials:</p>
  
  <ol>
  <li><p>allocate ADInterstitialAd and set delegate</p>
  
  <pre><code>_interstitial = [[ADInterstitialAd alloc] init];
  _interstitial.delegate = self;
  </code></pre></li>
  <li><p>when ready, present Ad in some viewcontroller:</p>
  
  <pre><code>[_interstitial presentFromViewController:_rootViewController];
  </code></pre></li>
  <li><p>listen to delegate methods to detect when the user closed the interstitial ad:</p>
  
  <pre><code>- (void)interstitialAdActionDidFinish:(ADInterstitialAd *)interstitialAd
  {
      [self proceedToNextLevel];
  }
  </code></pre></li>
  </ol>
  
  <p>This used to work in iOS 7. In iOS8 however, while most of the delegate functions get called, interstitialAdActionDidFinish does not get called (interstitialAdDidUnload does get called, but only like 5 minutes later).</p>
  
  <p>So, there seems to be some new way of showing interstitial ads through a category on UIViewController: <a href="https://developer.apple.com/library/ios/documentation/iAd/Reference/UIViewController_iAd_Additions/index.html#//apple_ref/occ/instm/UIViewController/shouldPresentInterstitialAd" rel="nofollow">https://developer.apple.com/library/ios/documentation/iAd/Reference/UIViewController_iAd_Additions/index.html#//apple_ref/occ/instm/UIViewController/shouldPresentInterstitialAd</a></p>
  
  <p>So the new way would be:</p>
  
  <ol>
  <li><p>prepare ads through static method call:</p>
  
  <pre><code>[UIViewController prepareInterstitialAds];
  </code></pre></li>
  <li><p>when ready, request display of ad:</p>
  
  <pre><code>_rootViewController.interstitialPresentationPolicy = ADInterstitialPresentationPolicyManual;
  [_rootViewController requestInterstitialAdPresentation];
  </code></pre></li>
  </ol>
  
  <p>This does show the interstitial - however, since there is no delegate anymore, there is no way of telling when the user closed the interstitial.</p>
  
  <p>So the question is: How on iOS 8 (and also compatible to iOS 7) can we tell when a user closed an interstitial Ad?</p>
  
  <p>//edit:
  I also tried to query</p>
  
  <pre><code>    viewController.isPresentingFullScreenAd
  </code></pre>
  
  <p>repeatedly with a timer, but while this works on iOS 7, on iOS 8 the property is always returning true, even after the user closed the interstitial ad</p>