我在实施风扇插页式广告时遇到问题,我已正确完成了所有操作 但是当我想测试代码时,我得到了这个错误
com.example.smail E/Gbody: Interstitial ad failed to load: Cache Error
这是我的实现方式
if(FBORAD==0) {
interstitialAd = new com.facebook.ads.InterstitialAd(this, getString(R.string.fb_inter));
interstitialAd.loadAd();
Activity activity = this; // must be an Activity
interstitialAd.setAdListener(new InterstitialAdListener() {
@Override
public void onInterstitialDisplayed(Ad ad) {
// Interstitial ad displayed callback
Log.e(TAG, "Interstitial ad displayed.");
}
@Override
public void onInterstitialDismissed(Ad ad) {
// Interstitial dismissed callback
Log.e(TAG, "Interstitial ad dismissed.");
}
@Override
public void onError(Ad ad, AdError adError) {
// Ad error callback
Log.e(TAG, "Interstitial ad failed to load: " + adError.getErrorMessage());
}
@Override
public void onAdLoaded(Ad ad) {
// Interstitial ad is loaded and ready to be displayed
Log.d(TAG, "Interstitial ad is loaded and ready to be displayed!");
// Show the ad
interstitialAd.show();
}
@Override
public void onAdClicked(Ad ad) {
// Ad clicked callback
Log.d(TAG, "Interstitial ad clicked!");
}
@Override
public void onLoggingImpression(Ad ad) {
// Ad impression logged callback
Log.d(TAG, "Interstitial ad impression logged!");
}
});
}
这是我的代码,当我运行该应用程序时出现上述错误 有人可以帮我吗 我到处搜索,但不幸的是,facebook没有提供良好的文档
答案 0 :(得分:0)
这可能是因为您的测试缓存期结束了。
转到FB控制台,然后单击测试设备以刷新缓存。
刷新后,该错误应该消失了。