admob仅发送测试广告,而不发送真实广告 [英] admob only sends test ad not real ads

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

问题描述

我遵循了 https:// developers上的说明。 google.com/mobile-ads-sdk/docs/admob/android/quick-start


我将strings.xml中的测试代码更改为真实代码。但是该应用仍在显示测试广告。(我还没有将该应用发布到Play商店上)。


它在模拟器中显示为
https://drive.google.com/file/d/0B6InEecSXedCNmM4eUVrTzVGaFU/view?usp=sharing
此处是activity_main.xml代码

I followed instructions on https://developers.google.com/mobile-ads-sdk/docs/admob/android/quick-start

I changed the test code in strings.xml to real code. But the app is still showing test ads.(I have not posted the app on play store)

It appears in emulator like this https://drive.google.com/file/d/0B6InEecSXedCNmM4eUVrTzVGaFU/view?usp=sharing Here is activity_main.xml code

  android:layout_alignRight="@+id/adView"
    android:layout_alignEnd="@+id/adView" />
<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="@string/banner_ad_unit_id"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true">
</com.google.android.gms.ads.AdView>

这是Java代码的一部分

and here is a part of java code

    Button = (ImageButton) findViewById(R.id.button);
    Button.setOnClickListener(new MyOnClickListener());
    AdView mAdView = (AdView) findViewById(R.id.adView);
    AdRequest adRequest = new AdRequest.Builder().build();
    mAdView.loadAd(adRequest);
}


推荐答案

Google移动广告SDK将仅在模拟器上显示测试广告。如果您切换到实际设备上的调试,除非您通过addTestDevice调用注册该设备,否则您会看到实时的生产广告。

The Google Mobile Ads SDK will only display test ads on the emulator. If you switch to debugging on a real device, you will see live, production ads unless you register the device with the addTestDevice call.

正如Abishek指出的,在测试和调试时违反AdMob政策要求提供真实广告的行为,这可能会导致您的帐户被暂停。 SDK会自动请求测试广告以防止这种情况发生。

As Abishek points out, it is a violation of AdMob policy to request real ads when you're testing and debugging, and this can result in the suspension of your account. The SDK automatically requests test ads to prevent this from happening.

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

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