Admob test devices not showing simulator udid

admob, ios, iphone, objective-c

Solution

Enable test ads

On your iDevice, go to Settings > Privacy > Advertising and disable the 'Limit Ad Tracking' option. Then when you run your app on hardware, check Xcode's console: there you will see the ID, which you can add to the testDevices array.

Problem

I am implementing Admob on iOS app. I just downloaded Admob sample code and when I tried to run it on simulator, my console is saying `"To get test ads on this device, call: request.testDevices = NSArray arrayWithObjects:@"GAD_SIMULATOR_ID", nil];`". So, I added my mac udid and a testing device udid to an array and set that to request. But, still, app is showing the default banner instead of ads from my admob account. Also console is saying the same above message. Have anyone had any idea what am I missing here? Here is the code. ``` self.adBanner = [[[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner origin:origin]; self.adBanner.adUnitID = kSampleAdUnitID; self.adBanner.delegate = self; [self.adBanner setRootViewController:self]; [self.view addSubview:self.adBanner]; self.adBanner.center = CGPointMake(self.view.center.x, self.adBanner.center.y); GADRequest *request = [GADRequest request]; request.testing = YES; request.testDevices = [NSArray arrayWithObjects: @"XXXX-XXXX-XXXX-XXXX-XXXXXXXX", @"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", nil]; [self.adBanner loadRequest:request]; ``` BTW, I replaced the above `kSampleAdUnitID` with my `Admob` publisher ID and XXX with my mac id and device id.

Original source