Michel
Michel

Reputation: 11755

Testing AdMob on iOS

Beginning using AdMob in an iOS app, I have this question:

When I am testing my app, I should not be using real adds. For that I use:

bannerUnitID = "ca-app-pub-3940256099942544/2934735716" // Provided in Google’s tutorial.

All is fine with that. But I read I can also add my device for test using this:

// Requests test ads on test devices. 
request.testDevices = ["2077ef9a63d2b398840261c8221a0c9b"] // Using the proper code for my device obviously.

What is the difference between using the first way and the second way?

I tried and could see that with the second way, I seem to be getting real adds. It is not clear to me, what is going on here. Anyone with a clear view? Please explain.

Upvotes: 3

Views: 1539

Answers (1)

Viral Patel
Viral Patel

Reputation: 33438

"ca-app-pub-3940256099942544/2934735716" is an ad unit. It will still serve real ads, just that it is filtered out (probably) at google's end (since they have it in the examples). This will be replaced with your ad unit id.

"2077ef9a63d2b398840261c8221a0c9b" is the unique device identifier (mac address). If you add this only test ads will be added to the device as long as the test device is kept added, no matter what ad unit id you use. This is the recommended approach (and always let it be there for your development devices) to prevent accidental click and disabling of your account.

Upvotes: 1

Related Questions