iOS 7 iAd interstitial ads can not be closed by user

只愿长相守 提交于 2019-12-21 05:47:07

问题


when i display interstitial ads with

[interstitial presentFromViewController:self];

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

When i display the ad view with

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

i get no warning and the ad is loading but there is no (X) in the ad that the user can close the ad.

Do somebody knows how to fix this?


回答1:


hey there this is the troublemaker [interstitial presentInView:self.view]; instead try this (delegate methods) t'should be removed manualy

-(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 bug Use the old API or put custom x button .I thinks this is a bug from presentinView . i am not sure it could be apple desired feature there's no documentation on this.At least i haven't seen any.Please share if you find something official on this.



来源:https://stackoverflow.com/questions/22126107/ios-7-iad-interstitial-ads-can-not-be-closed-by-user

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!