AdMob - Testing Vs. Publishing

675 views Asked by At

So I have Google's AdMob in my application, and I'm wondering about a couple of the lines of code used to display a test add when testing on the simulator or device.

This is the code I use (as shown on Google Dev docs/tutorials):

//log version of Google Ads used.
NSLog(@"Google Mobile Ads SDK Version: %@", [GADRequest sdkVersion]);

//Replace this ad unit ID with your own ad unit ID.
self.bannerview.adUnitID = @"ca-app-pub-3940256099942544/2934735716";

self.bannerviewB.rootViewController = self;

GADRequest *request = [GADRequest request];
//Requests test ads on devices you specify. Your test device ID is printed to
//the console when an ad request is made. GADBannerView automatically returns
//test ads when running on a simulator.
request.testDevices = @[@"2077ef9a63d2b398840261c8221a0c9a"];// Eric's iPod Touch

[self.bannerviewB loadRequest:request];

My question is, do you leave the code in that checks if you're on your own device or not? This line:

//Requests test ads on devices you specify. Your test device ID is printed to
//the console when an ad request is made. GADBannerView automatically returns
//test ads when running on a simulator.
request.testDevices = @[@"2077ef9a63d2b398840261c8221a0c9a"];// Eric's iPod Touch

Because I recently noticed, when I downloaded my own app from the App Store, it still displayed test ads, and this may be the reason why...? I've only just thought about this when developing my second app.

Thank you.

1

There are 1 answers

2
Daniel Storm On BEST ANSWER

My question is, do you leave the code in that checks if you're on your own device or not?

If you leave request.testDevices = @[@"testID"] in your distributed application test ads will be shown to your users. You need to remove or comment out this line before submitting your application to the App Store.