Device ID console message is NOT printing out for my new device

630 views
Skip to first unread message

joe2885

unread,
Nov 25, 2016, 8:12:05 PM11/25/16
to Google Mobile Ads SDK Developers
Hello All,

Just got a new iPad. I want to get it set up to use test ads from AdMob. I did this with my iPhone a while back (so the exact steps I took is unclear), but with my iPad, nothing is printing to the console with a device ID to use to get test ads.

Here's my code in ViewController.swift

import GoogleMobileAds
import UIKit

class ViewController: UIViewController, GADBannerViewDelegate {

  @IBOutlet weak var bannerView: GADBannerView!

  override func viewDidLoad() {
    super.viewDidLoad()
   
    bannerView.delegate = self
   
    bannerView.adUnitID = "ca-app-pub-xxxxxxxxxxx" (taken from my AdMob account)
   
    let myRequest = GADRequest()
    myRequest.testDevices = [kGADSimulatorID]
   
    bannerView.rootViewController = self
    bannerView.load(myRequest)
   
  }

}


I'm running this on my new iPad, and nothing prints to the console. Is there anything I need to do within the iPad to allow it to act as a test device?


Thanks in advance

Joshua Lagonera (Mobile Ads SDK Team)

unread,
Nov 28, 2016, 1:02:56 AM11/28/16
to Google Mobile Ads SDK Developers
Hi there,

To get the Advertising Identifier on an iOS Device, please ensure that the Limit Ad Tracking setting under Settings > Privacy > Advertising is turned OFF.
After turning it off, you should be able to see your Device ID on the logs after making an Ad Request.

Regards,
Joshua Lagonera
Mobile Ads SDK Team

joe2885

unread,
Nov 28, 2016, 10:40:53 AM11/28/16
to Google Mobile Ads SDK Developers
Joshua,

It was off. I toggled the switch, reset the identifier, and it's still not printing in Xcode using the code posted above. Are there any other methods I can use to print out the identifier?

Additionally, can you provide me with a test adUnitID that I can temporarily work with to get my device ID printed? I can't keep using my real adUnitID because real ads are displaying to my device.


Thanks in advance
Joe

Joshua Lagonera (Mobile Ads SDK Team)

unread,
Nov 28, 2016, 9:56:46 PM11/28/16
to Google Mobile Ads SDK Developers
Hi Joe,

Interesting. Usually when an Ad Request is requesting Live Ads, the Device ID should show on the logs if the Device has not been indicated as a Test Device. May we request the following details about your device:
  • iOS Version.
  • iPad Model. Does the issue only happen with your specific device?
  • SDK Version. If you're not using the latest version, can you try updating to the latest version and see if it will help remedy the issue?
As for your second concern, you may use the following Ad Unit IDs for testing purposes (do note that these may show Live Ads, but are made specifically for testing purposes):
Joshua Lagonera
Mobile Ads SDK Team

joe2885

unread,
Nov 29, 2016, 1:57:14 PM11/29/16
to Google Mobile Ads SDK Developers

Joshua,


I believe I have resolved this issue. Toggling the Limit Ad Tracking on my new iPad ALSO toggled it on my iPhone. I spent the better part of 12 hours trying to debug the same issue on my iPhone running builds of my apps that worked just fine before my iPad. (did this after your suggestion of: Does the issue only happen with your specific device?) Didn’t realize that toggling the Limit Ad tracking switch on my iPad also changed it on my iPhone.


I don’t have an answer as to why/how the hashed device ID never printed out to the iPad in the first place. But I created a new project from scratch, added the SDK & GADRequest, and finally got the device ID to print out for the iPad. (This is after several computer / ipad / iphone restarts, an upgrade to the latest SDK, AND quadruple checking that Limit Ad Tracking was OFF on all my devices).


All my testDevices arrays are now functioning properly with my phone, ipad and simulator. All are receiving the correct Test Ads.

Thanks again for your help here!

Joe










Reply all
Reply to author
Forward
0 new messages