BUG REPORT using GADAdSizeFromCGSize() iOS 6.10 AND ONWARD

46 views
Skip to first unread message

skyler.w...@mapmyfitnessinc.com

unread,
Oct 22, 2014, 1:33:03 PM10/22/14
to google-adm...@googlegroups.com
Seeing an initializing bug happening when trying to instantiate a DFPBannerView using a custom size in SDK 6.10 and upward. We had to revert to 6.9.2 because of the error.

DFPBannerView *newAdd = [[DFPBannerView alloc] initWithAdSize:GADAdSizeFromCGSize(CGSizeMake(700,350))];

This causes the add to log an exception telling me that it could not be created and to use either a constant or a custom size created with GADAdSizeFromCGSize(). However, as you can see I am doing just that. The validSizes property can only be set after instantiation so it is of no use. I have found a hack that seems to work, although the error is still logged and the behavior is unpredictable. If I instantiate it with kBannerSize included in the SDK, and then use the resize function, I can get it to convert over to 700x350, however the error is still logged and as stated before the behavior is not optimal. Reverting back to 6.9.2 and below, the issue is not present.

Eric Leichtenschlag

unread,
Oct 22, 2014, 7:28:01 PM10/22/14
to google-adm...@googlegroups.com
You're probably getting this because your CGSize, 700x350, is bigger than the screen bounds of your device. If you create a valid size, it'll work.

The next SDK version will have a more intuitive error message when a case like this happens.

Thanks,
Eric
Message has been deleted

skyler.w...@mapmyfitnessinc.com

unread,
Oct 23, 2014, 10:55:23 AM10/23/14
to google-adm...@googlegroups.com
Hey Eric

     Thanks for the reply. The iPhone 6 has a physical pixel size of 750x1334 and we are still seeing the issue there. Does the CGSize creation validate by points?

Thanks,
Skyler 

skyler.w...@mapmyfitnessinc.com

unread,
Oct 23, 2014, 4:51:49 PM10/23/14
to google-adm...@googlegroups.com
Still seeing the issue when doing this as well:

            GADAdSize size2 = GADAdSizeFromCGSize(CGSizeMake(700, 350));
            NSArray *validSizes = @[[NSValue valueWithBytes:&size2 objCType:@encode(GADAdSize)]];
            
            DFPBannerView *newAdd = [[DFPBannerView alloc] initWithAdSize:kGADAdSizeBanner];
            newAdd.validAdSizes = validSizes;

On Wednesday, October 22, 2014 6:28:01 PM UTC-5, Eric Leichtenschlag wrote:

Eric Leichtenschlag

unread,
Oct 23, 2014, 7:06:39 PM10/23/14
to google-adm...@googlegroups.com
It doesn't go by physical pixel size, but a density-independent size. If you create a UIView with 700x350 and set the background color you'll see it probably covers more than the full screen.

Another way to verify the limits is to check the size of [[UIScreen mainScreen] bounds].
Reply all
Reply to author
Forward
0 new messages