【问题标题】:AdMob on iOS: Disable in-app AdMob Webpage Ads?iOS 上的 AdMob:禁用应用内 AdMob 网页广告?
【发布时间】:2012-11-07 19:42:23
【问题描述】:

我正在使用 AdMob 的中介功能向我的 iPhone 应用程序投放 iAd 和 AdMob 广告。但是,我注意到一些 AdMob 广告确实很烦人……

一些 AdMob 广告直接在我的应用程序中打开网页,位于导航栏和标签栏之间,并且无法正确显示。它们没有像 iAd 那样完全模态化,而是侵入了我的应用程序空间(并且做错了)。

有没有办法挑选出这些 AdMob 广告并仅禁用那些试图在应用网页中打开的广告?我对打开 AppStore 或 Safari 的 AdMob 广告没问题。

在下面,您可以看到发生的事情之前和之后。

再一次,这很烦人,因为 iAd 工作得很好并且表现如预期,模态地占据了整个屏幕。另一方面,AdMob 对其在我的视图层次结构中的位置做出了错误的假设。我可能可以重新设计我的层次结构以“让它发挥作用”,但在我看来,当前的层次结构已经很理想,其他任何东西都会让人觉得被破解了。

如果我无法让 AdMob 正常运行,我的备用计划是简单地禁用 AdMob 广告。

【问题讨论】:

    标签: ios admob iad ads


    【解决方案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
    }
    

    【讨论】:

    • 我目前正在将bannerView.rootViewController 设置为self。但是,我尝试将其设置为 [UIApplication sharedApplication].delegate.window.rootViewController,但效果喜忧参半……它修复了 iOS 6 之前的问题,但在 iOS 6 设备上解决了该问题。现在,iAd 将显示在导航栏后面。
    • 另外,我遇​​到了另一个问题,即 iAd 正在更改父视图的框架大小,而不是在退出时重置它。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-16
    • 1970-01-01
    相关资源
    最近更新 更多