title: How to dismiss Interstitial ad programmatically in ios
body: <p>I have integrated Interstitial Ad for my iOS app successfully. And I know on that ad view there is a close button and we can dismiss it after clicking that button.</p>
  
  <p>But I want to dismiss this ad view in programmatically after 3 seconds. But I don't know what is the method to dismiss this ad.</p>
  
  <p><strong>---- UPDATED-----</strong></p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
      singletonClassObject=[Singleton SharedManager];
  
      //--------ADMOB FULLSCREEN----------
      self.interstitial = [[GADInterstitial alloc] init];
      self.interstitial.delegate = self;
  
      self.interstitial = [[GADInterstitial alloc] init];
      self.interstitial.adUnitID = @"ca-app-pub-3940256099942544/4411468910";
  
      GADRequest *request = [GADRequest request];
      // Requests test ads on simulators.
      request.testDevices = @[ GAD_SIMULATOR_ID, @"MY_TEST_DEVICE_ID" ];
      [self.interstitial loadRequest:request];
      //--------END OF AD MOB FULLSCREEN---------
  }
  </code></pre>
  
  <p>This is how show the ad in a click event</p>
  
  <pre><code>  if ([self.interstitial isReady]) {
       [self.interstitial presentFromRootViewController:self];
    }
  </code></pre>
  
  <p>These are the delegates that fire when app dismiss,shows etc</p>
  
  <pre><code>/// Called when an interstitial ad request succeeded.
  - (void)interstitialDidReceiveAd:(GADInterstitial *)ad {
      NSLog(@"interstitialDidReceiveAd");
  }
  
  /// Called when an interstitial ad request failed.
  - (void)interstitial:(GADInterstitial *)ad didFailToReceiveAdWithError:(GADRequestError *)error {
      NSLog(@"interstitialDidFailToReceiveAdWithError: %@", [error localizedDescription]);
  }
  
  /// Called just before presenting an interstitial.
  - (void)interstitialWillPresentScreen:(GADInterstitial *)ad {
      NSLog(@"interstitialWillPresentScreen");
  }
  
  /// Called before the interstitial is to be animated off the screen.
  - (void)interstitialWillDismissScreen:(GADInterstitial *)ad {
      NSLog(@"interstitialWillDismissScreen");
  
      //[viewAdd removeFromSuperview];
      [self.view removeFromSuperview];
  }
  
  /// Called just after dismissing an interstitial and it has animated off the screen.
  - (void)interstitialDidDismissScreen:(GADInterstitial *)ad {
      NSLog(@"interstitialDidDismissScreen");
      [self.view removeFromSuperview];
  }
  
  /// Called just before the application will background or terminate because the user clicked on an
  /// ad that will launch another application (such as the App Store).
  - (void)interstitialWillLeaveApplication:(GADInterstitial *)ad {
      NSLog(@"interstitialWillLeaveApplication");
  }
  </code></pre>