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

前端 未结 3 580
离开以前
离开以前 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条回答
  •  鱼传尺愫
    2020-12-10 20:17

    There is no equivalent. The Firestore SDK currently doesn't have presence management like the Realtime Database SDK.

    Instead, you might want to use the Realtime Database onDisconnect() in conjunction with Cloud Functions to kick off some work when the client disconnects from RTDB. You would be assuming that that your app probably also lost its connection to Firestore at the same time.

提交回复
热议问题