简体   繁体   中英

AdMob on iOS: Disable in-app AdMob Webpage Ads?

I'm using AdMob's mediation abilities to deliver both iAds and AdMob ads to my iPhone app. However, I'm noticing something REALLY annoying from some of the AdMob ads...

Some AdMob ads are opening webpages directly inside my application, in between my Nav bar and Tab bar, and aren't displaying correctly. Instead of being fully modal like iAds, they are invading my application's space (and doing it wrong).

Are there ways to single out these AdMob ads and disable just the ones that attempt to open in app webpages? I am fine with the AdMob ads that open the AppStore or Safari.

Below, you can see a before and after of what is going on.

之前

后

Again, it is annoying because iAds work just fine and behave as expected, taking over the entire screen modally. On the other hand, AdMob is making incorrect assumptions about its position in my view hierarchy. I could probably redesign my hierarchy to "make it work", but imo, the current hierarchy is already ideal and anything else would feel hacked together.

My backup plan, if I cannot get AdMob to behave itself, is to simply disable AdMob ads.

Are you setting the rootViewController of the BannerView correctly?

Here's an excerpt from the viewDidLoad method in one of my view controllers...

- (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
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM