4

I show a full screen advertisement with this code, which works showing a full page advertisement. The problem is that when I close the advertisement I just have a blank screen. It does not show my app anymore.

My code:

-(void)showFullScreenAd {
    if (requestingAd == NO) {
        interstitial = [[ADInterstitialAd alloc] init];
        interstitial.delegate = self;
        self.interstitialPresentationPolicy = ADInterstitialPresentationPolicyManual;
        [self requestInterstitialAdPresentation];
        NSLog(@"interstitialAdREQUEST");
        requestingAd = YES;
    }
}
MSU_Bulldog
  • 3,501
  • 5
  • 37
  • 73

1 Answers1

1

Found a solution. I just needed to present my view controller again when the advertisement had been closed. I used the following code:

-(void)interstitialAdActionDidFinish:(ADInterstitialAd *)interstitialAd {
    interstitial = nil;
    requestingAd = NO;
    NSLog(@"interstitialAdDidFINISH");

    // present my view controller again
    ViewController *myVC = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
    [self presentViewController:myVC animated:YES completion:nil];

}
MSU_Bulldog
  • 3,501
  • 5
  • 37
  • 73
  • 1
    I posted a comment about this very issue at http://stackoverflow.com/a/31790963/455791. In short, it's better to present the ad in a new UIViewController and then dismiss that view controller once the ad finishes. – PeqNP Aug 03 '15 at 15:21