Reputation: 9139
I'm close to pushing my app to the app store and before I do I would like to make sure my adMob Banner will eventually show actual ads. How do I ensure it will show live ads? Currently my code looks like this.....
bannerView.adUnitID = "ca-app-pub-***********/**************"
bannerView.rootViewController = self
bannerView.delegate = self
let request = GADRequest()
request.testDevices = [kGADSimulatorID]
bannerView.loadRequest(request)
bannerView.center = adCell.contentView.center
adCell.addSubview(bannerView)
Upvotes: 1
Views: 1715
Reputation: 1664
To not show test ads in the simulator, simply remove/comment out the line:
request.testDevices = [kGADSimulatorID]
This line tells AdMob to show test ads when run in the simulator (and any other device identifiers put in the array). If you were to test it on a real device right now, you would see normal ads. This line of code doesn't even need to be removed for real ads to show on a real device because you're not telling it to show test ads on any specific devices anyway (just the simulator).
Clicking your own ads can get your account banned from AdMob, so be extremely careful when testing with real ads.
Upvotes: 2