android - How to detect a client that stops listening in firebase? -


let's have 3 clients listening changes on firebase root. each client represents user in list (or map) on root. want remove user loses connection or closes client app (i.e. stops listening). how can detect when happens , handle change?

super easy. check out ondisconnect(). can write data out node when user disconnects or update value in node. example, on disconnect change user status (maybe stored in users node) status:disconnected.


Comments

Popular posts from this blog

html - height not adding height to a empty div -

python - Robot Framework location and name of keyword -

Desktop Launcher for Python Script Starts Program in Wrong Path (Linux) -