Reputation: 375
I have recently updated my app to use version 7.1.0 of the GoogleMobileAdsSDK. Following the update, the ads have changed from being live ads to test ads, despite me not making any changes to the code used to create the ads. Will the ads also be test ads on devices which download my app, or is this normal in version 7.1.0 of the SDK?
Here is the code I am using to produce the banner:
+ (void)createBanner:(UIViewController *)sender {
if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone)
{
bannerHeight = 50;
}
else
{
bannerHeight = 90;
}
GADRequest *request = [GADRequest request];
// request.testDevices = [NSArray arrayWithObjects:GAD_SIMULATOR_ID, nil];
bannerView = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner];
bannerView.adUnitID = @"ca-app-pub-1852329945819279/3391317943";
bannerView.rootViewController = (id)self;
bannerView.delegate = (id<GADBannerViewDelegate>)self;
senderView = sender.view;
bannerRect = [bannerView bounds];
bannerView.frame = CGRectMake(0, 0, senderView.frame.size.width, bannerHeight);
[bannerView loadRequest:request];
containerView = [[UIView alloc] initWithFrame:senderView.frame];
bannerContainerView = [[UIView alloc] initWithFrame:CGRectMake(0, senderView.frame.size.height, senderView.frame.size.width, bannerHeight)];
for (id object in sender.view.subviews) {
[object removeFromSuperview];
[containerView addSubview:object];
}
[senderView addSubview:containerView];
[senderView addSubview:bannerContainerView];
}
+ (void)adViewDidReceiveAd:(GADBannerView *)view
{
[UIView animateWithDuration:0.5 animations:^{
containerView.frame = CGRectMake(0, 0, senderView.frame.size.width, senderView.frame.size.height - bannerHeight);
bannerContainerView.frame = CGRectMake(0, senderView.frame.size.height - bannerHeight, senderView.frame.size.width, bannerHeight);
[bannerContainerView addSubview:bannerView];
}];
}
Since updating the SDK to 7.1.0, I have not changed this code at all, yet test ads now appear, hence my confusion. All help appreciated. Thank you.
Upvotes: 0
Views: 335
Reputation: 1254
https://developers.google.com/mobile-ads-sdk/docs/admob/ios/targeting#test_ads
According to the documentation: Note: Starting in SDK version 7.0.0, simulators will automatically show test ads.
Upvotes: 3