11

I have implemented firebase ads like in the exampe:

 @Override
 public void onCreate(Bundle savedInstanceState) {
     (...)
     mAdView.loadAd(adRequestBuilder.build());

 }

 @Override
 public void onResume() {
     mAdView.resume();
 }

 @Override
 public void onPause() {
     mAdView.pause();

 }

 @Override
 public void onDestroy() {
     mAdView.destroy();
 }

If the ad is successfully loaded or failed because of no Internet connection (errorCode 2) it is still going to be refreshed:

I/Ads: Scheduling ad refresh 60000 milliseconds from now.

The same message we get when we go background and then foreground (mAdView.resume() , mAdView.pause()).

But if we get "no fill"

No fill from ad server. Failed to load ad: 3

firebase stops requesting for new ads. It means that the user won't see any new ads (or even the first one if the first request finished with "no fill"). Furthermore if the app goes background then foreground (mAdView.resume() is being called), the ad request still won't be performed. That means that that the user who got "no fill" can see no ads for very long time. That can lower my income.

Is it correct behavior of the ads library or is it a bug? How to resolve this problem?


Update

I have one idea. Moving mAdView.loadAd(adRequestBuilder.build()) from onCreate() to onResume() method force to reload the ad when user comes back from the background.

@Override
public void onResume() {
    if (!mAdView.isLoading())
        mAdView.loadAd(adRequestBuilder.build());
    mAdView.resume();
}

What is interesting, after a lot of tests, calling mAdView.loadAd(adRequestBuilder.build()) after No fill from ad server. Failed to load ad: 3 forces to reload ad (I'm getting the message: Starting ad request.) but it have never finished with success. I still get No fill from ad server. Failed to load ad: 3. And the response is very quick. I assume it arrives from some kind of local cache.

AppiDevo
  • 3,195
  • 3
  • 33
  • 51
  • I can't find it in documentation, but I thinks it's logical that its stops refreshing request. No fill means no ads avaiable and that means that the new ad must be added by advertiser, so to avoid unnecesary network connections/background job etc, there is stop in refreshing. Better ask Admob team about it at https://groups.google.com/forum/#!forum/google-admob-ads-sdk – Wrobel Mar 01 '18 at 16:08
  • But if I correctly understand how it works, user who encountered the "no fill" error won't see ads in the future, even if new ads are added by advertiser. And I don't think that sending a simple error message is a huge load on the network. – AppiDevo Mar 01 '18 at 21:45

1 Answers1

0

Solved

The Problem is AdMob won't serve your app AdRequests if you didn't create an app-ads.txt file and place it in an accessible domain.

To Fix This issue follow the Bellow steps:

  1. go to https://apps.admob.com/v2/apps/appadstxt
  2. copy the code-snippet in the "set up app-ads.txt" dialog.
  3. use https://app-ads-txt.com to create your app-ads.txt file and place it in a free domain.
  4. go to https://play.google.com/console/ choose to see all apps, select the app that doesn't receive ads.
  5. go to the store-setting page, update the website URL in the store-listing-contact-details section and paste the generated URL from app-ads-txt.com.
  6. you have to wait around 24h for google to verify your Admob account and start serving your app AdRequests.
Basil Rawa
  • 109
  • 1
  • 5