0

I have an android app and I have the firebase lib in it. I was wondering if there a way I can somehow "log" or count the number of times a method was triggered and see it in the Firebase console?

For example, I have a method X inside my android app, and I want to see in my firebase console, how many time the X method was activated (cuz of the user flow in the app)

Alex Mamo
  • 130,605
  • 17
  • 163
  • 193
Finer
  • 19
  • 1
  • 8

1 Answers1

1

There is nothing built-in that can tell you how many times a method is triggered. If you need such a counter, you need to create one yourself. Meaning that every time the method is triggered, update the counter by one. You can achieve that using a transaction, as explained in my answer from the following link:

Or by simply using:

mDatabase.setValue(ServerValue.increment(1));

As explained here:

Alex Mamo
  • 130,605
  • 17
  • 163
  • 193