Search code examples
admob

AdMob Open app ad showing even after resuming the app


I implemented AdMob's open app ad and it is showing way to often - every time the app is opened, every time the app is resumed. I tried to find a way to "sleep" the ad for some period and it led to no avail. Does AdMob support this scenario? Any help will be appreciated.


Solution

  • The current AppOpenAd implementation is based on the idea of showing Ads on the app's onResume() state, no matter how frequently your App hits that state. If a cached Ad is available, it will be shown.

    There are 2 ways to handle this scenario here:

    1. Use Frequency Capping from your AdMob dashboard.
      AdMob Dashboard > App > Ad Units > Select Ad Unit > Advanced Settings > Frequency Capping.

    2. You could change the behaviour via the ProcessLifecycleOwner's observer.
      You can locally save the time (Eg: SharedPreferences) when the Ad is shown via the onAdShowedFullScreenContent callback & then check again later in the onResume() if it is suitable to show the Ad again by comparing the (currentTime - savedTime).

    You can also try this library that I've created that could help: https://github.com/ItzNotABug/AppOpenAdManager