IOS 7 iAd cross-site ads cannot be closed by user

when I show interstitial ads with

[interstitial presentFromViewController:self];

I get a warning that this method is deprecated in iOS 7. But it still works fine!

When I show an ad type using

 [self requestInterstitialAdPresentation]; [interstitial presentInView:self.view]; 

I do not receive a warning and the ad is loading, but there is no (X) in the ad that the user can close the ad.

Does anyone know how to fix this?

+3
source share
1 answer

Hey, this is a troublemaker [interstitial presentInView: self.view]; instead try this (delegate methods) t'should be removed manually

 -(void)interstitialAdDidLoad:(ADInterstitialAd *)interstitialAd{ if (interstitial != nil){ _adPlaceholderView = [[UIView alloc] initWithFrame:self.view.bounds]; [self.view addSubview:_adPlaceholderView]; [interstitial presentInView:_adPlaceholderView]; } and on did unload - (void)interstitialAdDidUnload:(ADInterstitialAd *)interstitialAd { NSLog(@"ad has been unloaded"); [_adPlaceholderView removeFromSuperview]; _adPlaceholderView = nil; } 

I have the same error. Use the old API or add a custom x button. I think this is a bug from presentinView. I'm not sure if this may be an apple feature desired; there is no documentation on this. At least I have not seen anyone. Please share if you find something official in this.

+1
source

Source: https://habr.com/ru/post/1202797/


All Articles