Count Downloads In Firebase And Then Show In App


(Shubham Chaudhary) #1

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


(Cian) #2

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.


(Vaibhav The Developer) #3

Use Realtime Firebase Database .
solve


(Pme) #4

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


(Cian) #5

It is a realtime database down to milliseconds.

You wont have a conflict.


(Shubham Chaudhary) #6

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


(Cian) #7

Show your blocks

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


(Shubham Chaudhary) #8

can you give me aia


(Cian) #9

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. @hackinggyann000 gave a great start.

(Pme) #10

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


(Cian) #11

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.


(Pme) #12

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.


(Cian) #13

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.


(Pme) #14

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


(Vaibhav The Developer) #15

Watch this video


(Shubham Chaudhary) #16

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


(Vaibhav The Developer) #17

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


(Shubham Chaudhary) #18

i tried but its not working