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.