【发布时间】:2019-05-29 00:27:57
【问题描述】:
我在实施粉丝插页式广告时遇到问题 我已正确完成所有操作 但是当我想测试代码时,我得到了这个错误
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 没有提供好的文档
【问题讨论】:
标签: android facebook-audience-network