1

AdMob 激励视频广告仅在连接到 wifi 时才会显示。我已将我的设备添加为测试设备。在开发时,连接到 wifi 的设备和广告每次都能完美加载。在 Play 商店发布后,广告无法在移动网络中加载。有什么想法可以解决这个问题吗?

使用这些依赖项。

compile 'com.google.firebase:firebase-ads:15.0.0'
compile 'com.google.android.gms:play-services-analytics:15.0.0'

并在 Application 类中初始化它

 MobileAds.initialize(this, getResources().getString(R.string.ad_app_id));

活动中

mRewardedVideoAd = MobileAds.getRewardedVideoAdInstance(this);
mRewardedVideoAd.setRewardedVideoAdListener(this);
mRewardedVideoAd.loadAd(getResources().getString(R.string.rewarded_add_exam),
            new AdRequest.Builder()
                    .addTestDevice("9438A393A3A730B0EECFA534004F7E6E")
                    .build());

@Override
public void onRewardedVideoAdLoaded() {
    if (mRewardedVideoAd.isLoaded()) {
        mRewardedVideoAd.show();
    }
}
4

0 回答 0