当我展示插页式广告时
[interstitial presentFromViewController:self];
我收到警告说此方法在 iOS 7 中已弃用。但它仍然可以正常工作!
当我用
显示广告 View 时[self requestInterstitialAdPresentation];
[interstitial presentInView:self.view];
我没有收到警告,广告正在加载,但广告中没有用户可以关闭广告的 (X)。
有人知道如何解决这个问题吗?
最佳答案
嘿,这就是麻烦制造者 [插页 presentInView:self.view]; 而是尝试这个(委托(delegate)方法)应该手动删除
-(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;
}
我有同样的错误使用旧的 API 或放置自定义 x 按钮。我认为这是来自 presentinView 的错误。我不确定这可能是苹果想要的功能,没有关于此的文档。至少我还没有看到任何文档。如果您发现有关此的官方信息,请分享。
关于ios7 - iOS 7 iAd 插屏广告无法被用户关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22126107/