-1

I've implemented Admob into my project however I can't add the test device for my iPhone.

Here is the code:

 let request = GADRequest()
    request.testDevices = [kGADSimulatorID, "XXXXX"]
    myAd = GADInterstitial(adUnitID: "ca-app-pub-4411736350819540/1731977917")
    myAd.delegate = self
    myAd.load(request)

My device ID isn't showing in the console when I run the app, it just shows an actual ad and not a test ad.

It works fine in Simulator.

Is the iPhone device ID meant to be the UDID found in iTunes?

When I comment out the testDevices line this is what the console shows:

2017-04-20 01:57:57.311 SpaceShip[2798:] <FIRAnalytics/INFO> Firebase Analytics v.3600000 started
2017-04-20 01:57:57.392 SpaceShip[2798:] <FIRAnalytics/INFO> To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled 
2017-04-20 01:57:57.398: <FIRInstanceID/WARNING> FIRInstanceID AppDelegate proxy enabled, will swizzle app delegate remote notification handlers. To disable add "FirebaseAppDelegateProxyEnabled" to your Info.plist and set it to NO
2017-04-20 01:57:57.397 SpaceShip[2798:] <FIRAnalytics/INFO> Successfully created Firebase Analytics App Delegate Proxy automatically. To disable the proxy, set the flag FirebaseAppDelegateProxyEnabled to NO in the Info.plist
true
2017-04-20 01:58:05.367 SpaceShip[2798:] <FIRAnalytics/INFO> Firebase Analytics enabled
Daniel Storm
  • 18,301
  • 9
  • 84
  • 152
Alex Ingram
  • 434
  • 4
  • 17

1 Answers1

0

Your test ID is not being printed in the console because you've already set your test ID with:

request.testDevices = [kGADSimulatorID, "XXXXX"] // It thinks "XXXXX" is your test ID

Comment out that from your request:

let request = GADRequest()
// request.testDevices = [kGADSimulatorID, "XXXXX"]
myAd = GADInterstitial(adUnitID: "ca-app-pub-4411736350819540/1731977917")
myAd.delegate = self
myAd.load(request)

After you comment it out run your application again. The test ID should now be in your console.

Once you have your test ID, uncomment request.testDevices, and then replace XXXXX with your test ID.

let request = GADRequest()
request.testDevices = [kGADSimulatorID, "XXXXX"]
myAd = GADInterstitial(adUnitID: "ca-app-pub-4411736350819540/1731977917")
myAd.delegate = self
myAd.load(request)
Daniel Storm
  • 18,301
  • 9
  • 84
  • 152
  • Unfortunately I don't get anything related to device ID. I've added the log in the original question – Alex Ingram Apr 20 '17 at 00:59
  • This works fine for the simulator. It says " To get test ads on this device, call: request.testDevices = @[ kGADSimulatorID ];" It just doesn't work on my device – Alex Ingram Apr 20 '17 at 01:10