Admob显示测试广告,但不显示真实广告 [英] Admob shows Test ads but not real ads

查看:832
本文介绍了Admob显示测试广告,但不显示真实广告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用admob展示Android广告。测试广告运行正常,但未展示真实广告。另外,对于真正的插页式广告,我也没什么问题,因为它们可以正常工作。只是真正的横幅广告没有显示。我的Java代码是

I'm using admob for showing android ads. The test ads are working fine but real ads are not shown. Also, I've no issue with real interstitial ads as they work fine. Just the real banner ads are not showing up. My java code is

private InterstitialAd interstitial;    
interstitial = new InterstitialAd(MainActivity.this);

        interstitial.setAdUnitId("ca-app-pub-********");

        AdView adView = (AdView) this.findViewById(R.id.adView);               
        AdRequest adRequest = new AdRequest.Builder()

        // Add a test device to show Test Ads
         .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
         .addTestDevice("4CCC00EF4EA205A6FE82E1AEB26B0839")
                .build();

        // Load ads into Banner Ads
        adView.loadAd(adRequest);

        // Load ads into Interstitial Ads
        //interstitial.loadAd(adRequest);

布局文件为

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ads="http://schemas.android.com/apk/res-auto"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <com.google.android.gms.ads.AdView
        android:id="@+id/adView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        ads:adSize="BANNER"
        ads:adUnitId="ca-app-pub-********" />

</LinearLayout>


推荐答案

在AdMob中新注册应用后,需要花费一些时间时间和一些广告请求以允许建立广告资源。因此,您可能不会立即看到实时印象。一旦您的应用开始发出更多请求,您应该会看到更一致的结果。请注意,测试广告的运作方式与实时广告相同。能够返回测试广告可确保您的应用程序与我们的网络正常通信。请耐心等待几天后再使用。

When apps are newly registered with AdMob, it takes some time and a few ads requests to allow inventory to build. Because of this, you may not see live impressions immediately. Once your app starts making more requests, you should see more consistent results. Please note that test ads operate through the same channels as live ads. Being able to return a test ad ensures that your application is communicating properly with our network. Be patience it will work after some days.

这篇关于Admob显示测试广告,但不显示真实广告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆