How to get kGADAdSizeSmartBannerPortrait to work

I cannot get kGADAdSizeSmartBannerPortrait to work.

Expected: On iPhone 6 Plus, the banner should be 414 pixels wide. On iPhone 6, the banner should be 375 points wide. On other iPhone and iPods, the banner will have 320 dots in this place.

Actual result: I see a “320x50 Test Banner” on all devices. On wide devices, a 320x50 banner is centered in the view. The remaining space on the left and right has a grayish pattern.

Used code:

GADBannerView* newbanner = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait];
NSLog(@"newbanner size: %@", NSStringFromCGSize(newbanner.frame.size));
newbanner.adUnitID = @"/6499/example/banner";
newbanner.rootViewController = self;
GADRequest *request = [GADRequest request];
request.testDevices = @[
                        @"somedeviceid1",
                        @"somedeviceid2",
                        ];
[newbanner loadRequest:request];
[self.view addSubview:newbanner];
newbanner.center = CGPointMake(self.view.frame.size.width * 0.5, self.view.frame.size.height * 0.5);

IPhone 6 Plus Screenshot:

Screenshot of iPhone 6 Plus announcing an incorrect smart banner size.

+4
source share
1 answer

kGADAdSizeSmartBannerPortrait Android ( ) iOS kGADAdSizeBanner, "" (aka image) 2x.

enter image description here

0

Source: https://habr.com/ru/post/1619289/


All Articles