Google Mobile Ads for iOS - Receiving ads with multiple sizes but adSizeDelegate not being called.

250 views
Skip to first unread message

Roberto Miranda

unread,
Nov 24, 2014, 9:36:28 AM11/24/14
to google-adm...@googlegroups.com
Hi, I am using Google Mobile Ads for iOS version 6.12.2 (using cocoapods).

I have set up my ads with the following code:

bannerView = [[DFPBannerView alloc] initWithAdSize:kGADAdSizeBanner];
bannerView
.adUnitID = @"my-ad-Unit-ID-XXX";
bannerView
.rootViewController = self.tableView.window.rootViewController;
bannerView
.delegate = self;

// Set possible ad sizes
GADAdSize size1 = GADAdSizeFromCGSize(CGSizeMake(320, 50));
GADAdSize size2 = GADAdSizeFromCGSize(CGSizeMake(320, 75));
GADAdSize size3 = GADAdSizeFromCGSize(CGSizeMake(320, 100));
GADAdSize size4 = GADAdSizeFromCGSize(CGSizeMake(320, 150));
[bannerView setValidAdSizesWithSizes:&size1, &size2, &size3, &size4, nil];
bannerView
.adSizeDelegate = self;

// Refresh the Ad
GADRequest *request = [SPAdRequestFactory targetedRequest];
// request.testDevices = @[ GAD_SIMULATOR_ID ];
[bannerView loadRequest:request];

The problem is that when I request an ad, the ad comes and I get the adViewDidReceiveAd: delegate call but I don't see any call to the adSizeDelegate:

- (void)adView:(GADBannerView *)view willChangeAdSizeTo:(GADAdSize)size {
   
...
   
NSLog(@"banner view size changed");
}

The ad displayed has a size visually different than the bannerView size. Do you have any ideas why this is happening? Thanks in advance.

PD: I don't have access to the google ad portal since the ads are handled by an ad agency, I only have access to the ad unit ID.

Andrew Brogdon (Mobile Ads SDK Team)

unread,
Nov 24, 2014, 8:02:24 PM11/24/14
to google-adm...@googlegroups.com
Thanks for providing so much detail with your post.  I'm trying some test scenarios out with DFPBannerView and its delegates, and I'll get back to you once I have something.

-Andrew

Roberto Miranda

unread,
Nov 26, 2014, 4:02:37 AM11/26/14
to google-adm...@googlegroups.com
Thank you very much for helping me. 

I have also noticed that sometimes the for the same ad the size changes (the ad size delegate is called) and sometimes not. As an example, for an ad with a height of 150, sometimes the ad is received and is placed with the default height of 50, resulting in a partially visible ad, but sometimes the size changed delegate method is called with the right height. Could be this a problem with the ad configuration in the portal?

Roberto Miranda

unread,
Dec 1, 2014, 9:29:58 AM12/1/14
to google-adm...@googlegroups.com
UPDATE: We have recently discovered that the problem was related to the ad agency configuration. So no more research is needed to be done on this bug.

ManueGE

unread,
Sep 1, 2015, 4:48:51 AM9/1/15
to Google Mobile Ads SDK Developers
My app is experiencing the same bug, do you remember what configuration issue was causing this problem?

Thanks!
Reply all
Reply to author
Forward
0 new messages