我在我的应用中完成了Google横幅广告和插页式广告的实施,并放置了我的单元ID,现在该应用已在Google Play上发布。那是从3.5天前。从那以后,我只能看到测试广告(没有显示实时广告)。所以,我想知道我是否错过了我应该在Admob或我的应用程序中实现的内容?
答案 0 :(得分:0)
如果您看到测试广告,则表示设置已正确完成。
你是否添加了这样的testDevice?
> AdRequest request = new AdRequest.Builder()
> .addTestDevice("33BE2250B43518CCDA7DE426D04EE232")
> .build();
如果是,则需要将其删除。
答案 1 :(得分:0)
通过ADMOB帐户添加付款信息
如果测试广告运行良好,则说明您的实现是正确的,但是您需要填写admob帐户中的“付款”选项。填写完该表格后,您将收到一封有关确认付款细节的电子邮件,并显示一条消息,指示是否您的信息已被admob小组接受,如果是,则将显示实时广告。 但请记住,广告最初不会展示。批准后也要花费一些时间。 这是错误代码的代码片段,以查找出问题所在
mAdView = (com.google.android.gms.ads.AdView) findViewById(R.id.adView);
mAdView.setAdListener(new com.google.android.gms.ads.AdListener() {
@Override
public void onAdLoaded() {
// Code to be executed when an ad finishes loading.
Toast.makeText(HomeActivity.this, "onAdLoaded", Toast.LENGTH_SHORT).show();
}
@Override
public void onAdFailedToLoad(int errorCode) {
if(errorCode==AdRequest.ERROR_CODE_INTERNAL_ERROR)
Toast.makeText(HomeActivity.this, "onAdFailedToLoad", Toast.LENGTH_SHORT).show();
// Code to be executed when an ad request fails.
}
@Override
public void onAdOpened() {
Toast.makeText(HomeActivity.this, "onAdOpened", Toast.LENGTH_SHORT).show();
}
@Override
public void onAdLeftApplication() {
Toast.makeText(HomeActivity.this, "onAdLeftApplication", Toast.LENGTH_SHORT).show();
}
@Override
public void onAdClosed() {
Toast.makeText(HomeActivity.this, "onAdClosed", Toast.LENGTH_SHORT).show();
}
});
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
获取错误代码
ERROR_CODE_INTERNAL_ERROR Something happened internally; for instance, an invalid response was received from the ad server.
ERROR_CODE_INVALID_REQUEST The ad request was invalid; for instance, the ad unit ID was incorrect.
ERROR_CODE_NETWORK_ERROR The ad request was unsuccessful due to network connectivity.
ERROR_CODE_NO_FILL The ad request was successful, but no ad was.
如果您收到错误代码3,则一段时间后,您会在一段时间后显示广告。