I have both banner and interstitial ads in my app, but when trying to load additional native ads which I want to use in recylerviews, the result of the load with AdLoader.Builder(...).forUnifiedNativeAd
is always :I/Ads: Received log message: <Google:HTML> The ad request returned a no fill for the particular slot. The error log below that says 'Malformed native JSON response' is a benign warning that will be removed in a future SDK release.
In my understanding the slot
is the "placement" of this particular native ad which I have populated with a correct native_ad_id. (In test this should be ca-app-pub-3940256099942544/2247696110
or ca-app-pub-3940256099942544/3986624511
)
My problem now, is that i won't be able to test the appearance of the native ads in the way which is described in: https://developers.google.com/admob/android/native/start
Why isn't there a "guarantee" on reliable results from test Ads ?
As far as I know (and understand) I have done correct, but the result from testAds will not fill...
Code snippets:
fun loadNativeAds() {
Log.i(TAG,"loadNativAds(): ")
val builder = AdLoader.Builder(context, getString(R.string.native_ad_unit_id_station_list))
adLoader = builder.forUnifiedNativeAd { unifiedNativeAd ->
Log.i(TAG,"loadNativeAds: Ad loaded: ${unifiedNativeAd.headline}")
nativeAds.add(unifiedNativeAd)
}.withAdListener(
object: AdListener() {
override fun onAdFailedToLoad(errorCode: Int){
Log.e(TAG,"loadNativeAds: The prevous native ad failed to load with error $errorCode." +
"Attempt to load another.")
}
}).withNativeAdOptions(
NativeAdOptions.Builder()
.setAdChoicesPlacement(ADCHOICES_TOP_RIGHT)
.build())
.build()
//adLoader?.loadAd(AdRequest.Builder().build())
adLoader?.loadAds(AdRequest.Builder().build(),5)
}
If I use loadAds
I get error 0
If I use loadAd
I get error 3
MobileAds.initialize(this,getString(R.string.mobileads_app_id))
is called in MainActivity
and as said, all Ad banners and interstitial are functioning properly.
Are there any (undocumented) conflicts between theese three (banner, interstitial, native) somewehere ?
RG
2020.02.09: Follow up, more information:
From a tip in a post (could not remember from where) was to use real ad-id's and run it on my emulator, those will be automatically marked as test. (You will get TestAd mark on the Ad). Then the error message changed to: I/Ads: Received log message: <Google:HTML> Incorrect native ad response. Click actions were not properly specified
Searching around in here and other places, there is not much answers... To rule out filtering in my network, I've run a test (NativeAdvancedExample), that seems to go ok.
So what am I doing wrong ?
RG