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

1 Like

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

1 Like

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

1 Like

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

1 Like

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

1 Like

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

2 Likes

right but iam using admob

2 Likes

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:

4 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.