我的问题是,Admob插页式广告正在测试模式中展示,但如果应用已发布,则不会显示广告。
像我一样使用 AdRequest mAdRequest;mAdRequest = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
`enter code here`.addTestDevice("12312132654654232").build();
但是在发布应用时,我使用了像这样的代码 -
AdRequest mAdRequest;
mAdRequest = new AdRequest.Builder().build();
enter code here
此行不显示广告。
答案 0 :(得分:1)
您是否在代码中使用了这些行? 第一...
private InterstitialAd interstitial;
// Create the interstitial.
interstitial = new InterstitialAd(this);
interstitial.setAdUnitId(MY_AD_UNIT_ID);
然后使用这行代码
// Create ad request.
AdRequest adRequest = new AdRequest.Builder().build();
// Begin loading your interstitial.
interstitial.loadAd(adRequest);
并且每当您想要显示添加调用此方法
// Invoke displayInterstitial() when you are ready to display an interstitial.
public void displayInterstitial() {
if (interstitial.isLoaded()) {
interstitial.show();
}
}
希望这会对你有所帮助。