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

3 Likes

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

3 Likes

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

3 Likes

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

3 Likes

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

2 Likes

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

3 Likes

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

5 Likes

right but iam using admob

5 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:

6 Likes

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