Tungki Reza Prasakti
Tungki Reza Prasakti

Reputation: 35

How to make AdMob insterstitial Ads delay for 1 min?

Lets say people start my application and they click for an activity from RecyclerView and it display interstitial ads then the application add gap for 1 min so user cant see ads even if they click for an Activity from RecyclerView.

When 1 min passed and they click another recycle view item for displaying another activity they can see another Intersials ads

How to implement that?

Upvotes: 3

Views: 720

Answers (2)

earthw0rmjim
earthw0rmjim

Reputation: 19427

Instead of doing this programmatically, you can simply set a frequency cap for your interstitial Ad:

  1. Sign in to your AdMob account at https://apps.admob.com.
  2. Click Apps in the sidebar.
  3. Select the name of your app. If you don't see it in the list of recent apps, you can click View all apps to search a list of all of the apps you've added to AdMob.
  4. Click App settings in the sidebar.
  5. Click Edit beside Interstitial frequency capping.
  6. Select an interstitial frequency capping option:

    • No cap on interstitial impressions in this app: Select this option to disable frequency capping for this app.
    • Enable the following cap per user: Enter the number of impressions you want to allow to appear per user across all interstitial ad units in this app and select a period of time (per minute, per hour, or per day).
  7. Click Save.

Upvotes: 1

Alireza Noorali
Alireza Noorali

Reputation: 3265

You can assign current time in milliseconds in an long variable and check difference between User Click Time and the previous time. If difference was bigger than 60*1000 milliseconds show advertisement.

Getting current time in milliseconds:

long savedTime = System.currentTimeMillis();

Needed condition:

    if (System.currentTimeMillis() - savedTime > 60 * 1000) { // 60,000 ms = 1 min
       //  Show Advertisement
    }

Upvotes: 0

Related Questions