2012-11-07 62 views
0

我正在使用AdMob的中介功能将iAds和AdMob广告投放到我的iPhone应用程序。但是,我注意到某些AdMob广告真的很恼人...iOS上的AdMob:禁用应用内AdMob网页广告?

某些AdMob广告直接在我的应用程序内部,我的导航栏和选项卡栏之间打开网页,并且显示不正确。它们不像iAds那样完全模式化,而是侵入我的应用程序空间(并且做错了)。

有没有方法可以挑选出这些AdMob广告并禁用那些试图在应用网页中打开的广告?我很喜欢打开AppStore或Safari的AdMob广告。

下面,你可以看到前后发生了什么。

Before

After

再次,这是烦人,因为网络成瘾者的工作只是罚款,并像预期的那样,接管整个屏幕模态。另一方面,AdMob对我的视图层次结构中的位置做出了不正确的假设。我大概可以重新设计我的层次结构以“让它工作”,但是imo,当前的层次结构已经很理想,而其他任何东西都会感觉受到攻击。

如果我无法让AdMob自行运作,我的备份计划就是停用AdMob广告。

回答

1

您是否正确设置BannerView的rootViewController?

下面是从viewDidLoad方法摘录在我看来,一个控制器...

- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 

    // Create a view of the standard size at the bottom of the screen. 
    // Available AdSize constants are explained in GADAdSize.h. 
    _bannerView = [[DFPBannerView alloc] initWithAdSize:kGADAdSizeBanner]; 
    _bannerView.delegate = self; 

    // Specify the ad's "unit identifier." This is your AdMob Publisher ID. 
    _bannerView.adUnitID = ADMOB_PUBLISHER_ID; 

    // Let the runtime know which UIViewController to restore after taking 
    // the user wherever the ad goes and add it to the view hierarchy. 
    _bannerView.rootViewController = self; 

    // SNIP 
} 
+0

我目前设置bannerView.rootViewController自我。不过,我尝试将它设置为[UIApplication sharedApplication] .delegate.window.rootViewController,并且取得了不错的成功...它修复了iOS 6之前的问题,但颠倒了iOS 6设备上的问题。现在,iAd将显示在导航栏后面。 – MikeS

+0

此外,我遇到了另一个问题,其中iAds正在更改父视图的框架大小,而不是在退出时重置它。 – MikeS