gpt4 book ai didi

firebase - firestore 中是否有像实时数据库中那样的 onDisconnect() 方法?

转载 作者:行者123 更新时间:2023-12-02 19:11:28 25 4
gpt4 key购买 nike

我想检查用户的在线状态,在实时数据库中我曾经借助 onDisconnect() 来检查这一点,但现在我已经转向 firestore 并且找不到任何类似的方法。

最佳答案

根据这个onDisconnect :

The onDisconnect class is most commonly used to manage presence in applications where it is useful to detect how many clients are connected and when other clients disconnect.

为了能够在 firestore 中使用状态,您需要将 firestore 与实时 firebase 连接(没有其他方法)。

请检查此以获取更多信息:

https://firebase.google.com/docs/firestore/solutions/presence

关于firebase - firestore 中是否有像实时数据库中那样的 onDisconnect() 方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49124817/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com