my iAd-integration does not work correctly. I tried to implement fullscreen ads. The ad appears but when I press the "X"-button to close, it does not close.
Maybe you can find an Issue in my code? I don't know what to change and have invested a lot of time in fixing the issue without success.
UPDATE
it works with [interstitial presentFromViewController:self];
but not with [interstitial presentInView:self.view];
The problem is that presentFromViewController is deprecated with iOS 7...so how do I have to change it?
- (void)viewDidLoad
{
requestingAd = NO;
[self showFullScreenAd];
}
//Interstitial iAd
-(void)showFullScreenAd {
//Check if already requesting ad
if (requestingAd == NO) {
interstitial = [[ADInterstitialAd alloc] init];
interstitial.delegate = self;
self.interstitialPresentationPolicy = ADInterstitialPresentationPolicyManual;
[self requestInterstitialAdPresentation];
NSLog(@"interstitialAdREQUEST");
requestingAd = YES;
}//end if
}
-(void)interstitialAd:(ADInterstitialAd *)interstitialAd didFailWithError:(NSError *)error {
interstitial = nil;
requestingAd = NO;
NSLog(@"interstitialAd didFailWithERROR");
NSLog(@"%@", error);
}
-(void)interstitialAdDidLoad:(ADInterstitialAd *)interstitialAd {
NSLog(@"interstitialAdDidLOAD");
if (interstitialAd != nil && interstitial != nil && requestingAd == YES) {
[interstitial presentInView:self.view];
NSLog(@"interstitialAdDidPRESENT");
}//end if
}
-(void)interstitialAdDidUnload:(ADInterstitialAd *)interstitialAd {
interstitial = nil;
requestingAd = NO;
NSLog(@"interstitialAdDidUNLOAD");
}
-(void)interstitialAdActionDidFinish:(ADInterstitialAd *)interstitialAd {
interstitial = nil;
requestingAd = NO;
NSLog(@"interstitialAdDidFINISH");
}
Thank you in advance :)