How to set only 5 ads per day

hello koders i am creating an app where users view ads to get free points and points can be used to view pdf files but i am not getting any concept of how to limit only 5 ads per day please help me through out this :smiling_face_with_three_hearts:
:smiling_face: `#bequick

1 Like

Use variable set value 0, when someone click on button display ad, after ad impression store value in variable with plus 1, then also store in tiny DB, again someone click the, check tiny DB value = 5 by using if else logic, then show alert else set again value plus one if you really need help then you can dm me for free

but if i store value in tiny db user will be unable to view ads on next day

Compare with dates. (Todays date Vs saved date)

Save the clicks and date under date tag.

In screen initialise
If the todays date is not equal to saved date
Then save the value as create empty list

So every day it restores the values

On ad finished
Save value in tinydb as make a list (item1 = today date)(item2=click count)

Simple

sorry but as iam new koder so can you send me block please dont say no @Still-learning

It is not matter whether you are newbie or experienced guy… :no_smoking:

It just logic that’s all

Anyway I am in outside… let me share you the blocks after few min

Some ad networks (Like Applovin) contain frequency capping options to limit number of ads per session/day/hour , etc

right but iam using admob

I don’t think you need to code even a single line to get it done!

Just enable capping for your ad unit and let AdMob handle the rest for you! :upside_down_face:

1 Like