While i test Admob in simulator, it throws below error
To get test ads on this device, call: request.testDevices = [NSArray arrayWithObjects:GAD_SIMULATO
Since the newest update the request.testDevices
has been replaced with:
GADMobileAds.sharedInstance().requestConfiguration.testDeviceIdentifiers
I have gotten it to work with this:
GADMobileAds.sharedInstance().requestConfiguration.testDeviceIdentifiers = [(kGADSimulatorID as! String)]
[EDIT]
In my app delegate I am using this code:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// use this for production
GADMobileAds.sharedInstance().start(completionHandler: nil)
// use this for testing
GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers = [ kGADSimulatorID ]
return true
}
This is for Swift 5, iOS 13 and Google-Mobile-Ads-SDK (7.58.0)