Count Downloads In Firebase And Then Show In App

is there any way to count downloads in firebase and then show it in app

suppose
i have 10 files in pdf
i want if any user download any files then download should show 1 and then again if any user download any files then it should show 2

i want seperate count for each of my files…

please help me anyone

Sure thing. After you get the file, get the counter, and increase it by 1. Use teh realtimedatabase as your counter source. and storage as the place for your files.

I keep total counts on all sorts of things, such as errors etc.

1 Like

Use Realtime Firebase Database .
solve

3 Likes

If two user do this think at the sametime its not work correct.I suggest append value and check list leght

2 Likes

It is a realtime database down to milliseconds.

You wont have a conflict.

1 Like

can anyone give me aia because all above answers are not working

Show your blocks

It works. I track 20 stats for all users at the same time, no problemski

can you give me aia

Mate, you said it is not working. Show what you have done, and I will help work through it. I cant give an AIA for a bunch of reasons:

  1. You need your own Firebase account, and details.
  2. I dont know the variables of what your are trying to do
  3. We teach people to fish, we do not give them fish.
  4. @vkpdeveloper gave a great start.

Nope ,maybe firebase is fast but you need think about user connection.For this problem your solution enought.But if someone desing multiplayer app using firebase ı dont recommed this

1 Like

You need to research what an RTB is.

Firebase is used for multiplayer games.

IF you cant use firebase as an RTB then you have needs that are far greater than most in use today.

I know it.I just thinking about special conditions.If user get value and lost connection with firebase for enought second for other users to update counter ,then reconnected firebase which value stored?.

If counter number is 763 and user get this number

He do local operation 763+1= 764 but he lost connection when storing this number.When he lost connection with firebase other users can increase counter number to 764 ,765 etc.So ıf user doesnt close app and reconnected firebase succesfull firebase update number to 764.And we miss other users increase operation by doing this.

So ı m wrong with my idea what you think ? I know its hard to happen but if we desing multiplayer apps we need think every problem.Yes maybe we have a world fastest database but if user connection can be slow we cant use these solutions.

You are splitting hairs.

If the system is so crucial that is canot accomodate the slight potential that there is a conflict, the Kodular is not the development platform to use.

This is not a conceptually intellectual debate. We can talk what if all day.

Dont let perfection get in the way of progress.

1 Like

Yea ı just thinking every think. I learned this from my experience.I already found solutions for this problems i will test them with my New multiplayer app.But need a time . Contiune this topic is useless :slight_smile:

Have a nice day

Watch this video

this video contain count in offline mode and i have no idea how to learn with it to do it online

On Element click use firebase get value and get value + 1

i tried but its not working

1 Like

Thanks its really works keep it up