-
I'm using @react-native-firebase/analytics in my app. I can log and the number a document is displayed. But is there anyway to get the count from the app and display it as view number? Of course I can manage the view number on my own by updating the document in firestore every time it is viewed. But it'll be more convenient to get it from analytics instead. This reduces the number of write and locking the document when writing, especially when there are too many active users accessing document. Updating it too frequently just for view number is not a good idea. But it seems like analytics is a "one way" write-only package. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
indeed - analytics is a one-way write-only package. There is no ability at all to count. You can wrap it if you want and use some local state management solution for a specific local device, but that's it. Or do something on the backend that uses analytics export to bigquery and checks through bigquery, in perhaps a firebase function. I'm not sure what your use case is though, so that may not fit at all. |
Beta Was this translation helpful? Give feedback.
indeed - analytics is a one-way write-only package. There is no ability at all to count. You can wrap it if you want and use some local state management solution for a specific local device, but that's it. Or do something on the backend that uses analytics export to bigquery and checks through bigquery, in perhaps a firebase function. I'm not sure what your use case is though, so that may not fit at all.