【问题标题】:admob only sends test ad not real adsadmob 仅发送测试广告而非真实广告
【发布时间】:2016-10-05 13:44:50
【问题描述】:

我按照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代码

  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代码的一部分

    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);
}

【问题讨论】:

    标签: android admob ads


    【解决方案1】:

    Google 移动广告 SDK 只会在模拟器上显示测试广告。如果您切换到在真实设备上进行调试,您将看到实时的生产广告,除非您使用 addTestDevice 调用注册设备。

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

    【讨论】:

    • 点击这样的添加,而不是一开始就请求它们是违反 admob 政策的。
    • 我们强调避免错误点击的重要性,因为这是更大的问题,但不使用测试广告造成错误印象也是违反政策的。
    【解决方案2】:

    您不能在开发期间使用实时广告,因为在开发期间使用实时广告违反 AdMob 政策,这样做可能会导致您的 AdMob 帐户被暂停。

    【讨论】:

    • 这是否也包括自家广告!!从技术上讲,它们应该允许测试自家广告!
    • 这不能回答问题。
    【解决方案3】:

    您必须更改横幅广告单元 ID。因为它的测试 id 显示了测试广告。您可以在strings.xml 中找到它们

    <string name="banner_ad_unit_id" translatable="false">pub-xxxxxxxxxxxxxxxxxxxxxxxxxxxx</string>
    

    【讨论】:

    • 如何将测试 id 更改为 live id
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-10
    • 2018-02-01
    • 1970-01-01
    相关资源
    最近更新 更多