android - 如何在我的 firebase 和 flutter 应用上创建实时用户数?
问题描述
我想在我的应用程序中包含一个文本框,显示应用程序当前有多少用户(并发用户)。我正在使用 Firebase 和颤振,我想知道是否有人有任何建议。我知道 firebase 会报告实时用户的数量以进行分析,但有没有办法获取这些数据并将其展示给用户?
解决方案
I would use a combination of a presence
state watcher like here for each user and save the presence state on the database AND a simple cloud function that listens to the changes and increments or decrements the total counter.
推荐阅读
- python - IndexError:检查回文时的字符串索引超出范围
- python - 激活功能时如何防止 Entry 小部件失去焦点?
- python - 如何有条件地选择要显示的行
- c++ - 整数下溢导致模数失败
- python - Pygame 与面具的碰撞
- spring-boot - springboot中预期json输出时的圆形视图路径[错误]
- angularjs - 从 ajax jquery 迁移到 angularjs $http
- javascript - 单击按钮时将组件添加到另一个组件
- f# - F# Async.Parallel |> Async.RunSynchronously 只使用八个 CPU 核心之一?
- python - 如何将词干应用到字典中?