Search code examples
androidadmobgoogle-chrome-arc

Ads on ARC Welder / ChromeOS


According to this: https://developer.chrome.com/apps/getstarted_arc#bestpractices Ads served through the Google Play Services API should work on ARC Welder but all I get in my app is the test banner as shown in the picture: enter image description here

Is there anything I need to do to make this work? As far as I can tell everything works, the ad is loaded like it does on Android but it just doesn't serve real ads. I'm using the exact same code to load ads on ARC Welder as I do on Android (including the same adUnitId). The same happens if you run the app on a Chromebook so it's not an ARC Welder issue. Interstitial ads don't show at all.

Here's how the the ad is loaded:

AdRequest.Builder adRequest = new AdRequest.Builder();
if (Debug.DEBUG_MODE) {
    adRequest.addTestDevice(AdRequest.DEVICE_ID_EMULATOR);
    adRequest.addTestDevice("F5281A44BC3A9D2A1F8610A73C7C5A3D");
    adRequest.addTestDevice("2E76737226676685E8D099929CDE097C");
    adRequest.addTestDevice("BD1C0F31A686C467D35C92281DFB80D6");
    adRequest.addTestDevice("407FB1B6C16E3A3E7F74E5F91DA17CA3");
}

admobView.setAdListener(new AdListener() {
    @Override public void onAdLoaded() {
        adView.setVisibility(View.VISIBLE);
    }
});

admobView.loadAd(adRequest.build());

Debug.DEBUG_MODE is false so the addTestDevice calls are never executed.


Solution

  • The Google Mobile Ads SDK always returns test ads when an emulator requests AdMob fill (to prevent production ads being used during development), and I bet that ARC triggers that behavior.

    I do not currently know of a workaround, though I should mention that this would not affect those loading ads from Doubleclick for Publishers (which also uses the Mobile Ads SDK).