Is there any method like onDisconnect() in firestore like there is in realtime database?

前端 未结 3 576
离开以前
离开以前 2020-12-10 19:44

I want to check user\'s online status, in realtime database I used to check this with the help of onDisconnect(), but now I\'ve shifted to firestore and can\'t find any simi

3条回答
  •  萌比男神i
    2020-12-10 20:16

    According to this 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.

    To be able to use presence in firestore, you need to connect firestore with realtime firebase(no other way).

    Please check this for more info:

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

提交回复
热议问题