我正在尝试在我的应用程序中实现NativeAd。
直到昨天,一切正常,现在正在打印这些错误日志。
I/Ads: WebView loading for native ads.
I/Ads: Javascript has loaded for native ads.
I/Ads: Received log message: <Google:HTML> Incorrect native ad response. Click actions were not properly specified
onAdFailedToLoad errorCode = 0
所以我不能再播放本地广告了。
下面是我如何处理请求的。
private AdRequest adRequest = new AdRequest.Builder()
.build();
private NativeAdOptions nativeAdOptions = new NativeAdOptions.Builder()
.setAdChoicesPlacement(ADCHOICES_TOP_RIGHT)
.setRequestMultipleImages(false)
.setReturnUrlsForImageAssets(true)
// Methods in the NativeAdOptions.Builder class can be
// used here to specify individual options settings.
.build();
AdLoader adLoader = new AdLoader.Builder(mContext, adUnitId)
.forAppInstallAd(new NativeAppInstallAd.OnAppInstallAdLoadedListener() {
@Override
public void onAppInstallAdLoaded(NativeAppInstallAd appInstallAd) {
refreshAd(appInstallAd);
}
})
.forContentAd(new NativeContentAd.OnContentAdLoadedListener() {
@Override
public void onContentAdLoaded(NativeContentAd contentAd) {
refreshAd(contentAd);
}
})
.withAdListener(adListener)
.withNativeAdOptions(nativeAdOptions)
.build();
adLoader.loadAd(adRequest);
如果我发表评论
forAppInstallAd
然后可以再次下载广告。但填充率很低。