Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Interstitial ads add test device?

You can easily add test devices with banner ads so you don't get banned by accidentally clicking on them. However I cannot find how to add test devices to interstitial ads. I assume you also can be banned if you click accidentally on them.

Can you add test devices to these and if so, how? I can't find it on the official google guide, nor on SA. How to get test ad Banners and test Interstitial ads working for adMob? did look promising, but there was no answer on how to add test devices.

like image 256
Gooey Avatar asked Feb 09 '14 19:02

Gooey


1 Answers

Can you add test devices to these and if so, how?

So here you go:

// request test interstitial ads
        AdRequest adRequestInterstitial = new AdRequest.Builder()
            .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
            .addTestDevice(testDeviceId)
            .build();

// request test banner ads
  AdRequest adRequestBanner = new AdRequest.Builder()
            .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
            .addTestDevice(testDeviceId)
            .build();
like image 151
Sagar Shah Avatar answered Sep 27 '22 19:09

Sagar Shah