Let's say I have 3 clients that are listening for changes on some firebase root. Each client represents themselves as a user in a List (or Map) on the root. I want to remove a user that loses their connection or closes their client app (i.e. stops listening). How can I detect when this happens and handle the change?
Asked
Active
Viewed 373 times
1 Answers
4
Super easy. Check out onDisconnect(). It can write data out to a node when the user disconnects or even update the value in a node. For example, on disconnect change the user status (maybe stored in your users node) to status:disconnected.

Jay
- 34,438
- 18
- 52
- 81
-
Thanks I was able to call `removeValue()` `onDisconncet()` – clocksmith May 29 '15 at 17:52