Managing Online Presence in Cloud Firestore

丶灬走出姿态 提交于 2020-01-14 10:12:15

问题


In Firebase Realtime Database, we can easily manage User presence by keeping a reference to a node and updating it as shown below:

DatabaseRef presenceRef = FirebaseDatabase.getInstance().getReference("disconnectmessage");

presenceRef.onDisconnect().setValue("I disconnected!");

If I want to do the same in Cloud Firestore, is there any way to achieve it?


回答1:


You can easily use both Cloud Firestore and Realtime Database in the same project. For presence, we recommend you still use the Realtime Database to handle it.



来源:https://stackoverflow.com/questions/46582975/managing-online-presence-in-cloud-firestore

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!