I've implemented AdMob in to my application, but I'd like to ensure that the logic in the adViewWillPresentScreen:
and adViewDidDismissScreen:
methods are correct.
I have added my device's ID as a test device, so that I am only displayed test adverts. However, when I tap on the test advert, I am taken directly out of the app, rather than a screen (such as the App Store) being displayed. This means that the above methods are not being fired, and I am unsure how to test them without removing my device from the array of test devices and creating a false impression by tapping on one of my own ads - potentially repeatably while debugging.
Code creating banner:
let bannerView = GADBannerView(adSize: size)
bannerView.delegate = self
bannerView.adUnitID = "<redacted>"
bannerView.rootViewController = rootViewController
let request = GADRequest()
request.testDevices = [
kGADSimulatorID,
"<redacted>" // Test device
]
bannerView.loadRequest(request)
I have also tried an example adUnitID (ca-app-pub-3940256099942544/6300978111
), which even when my device is not in the array of test devices displayed the example advert.
adViewWillPresentScreen:
method. I am looking for a way to load a test advert which shows a modal screen when tapped.