OnDisconnect
The OnDisconnect class is used to manage operations that will be run on the server when this client disconnects. It can be used to add or remove data based on a client's connection status. It is very useful in applications looking for 'presence' functionality.
Instances of this class are obtained by calling DatabaseReference.onDisconnect on a Firebase Database ref.
Properties
Functions
Link copied to clipboard
Remove the value at this location when the client disconnects
Link copied to clipboard
inline suspend fun <T> setValue(strategy: SerializationStrategy<T>, value: T, buildSettings: EncodeSettings.Builder.() -> Unit = {})
Ensure the data at this location is set to the specified value when the client is disconnected (due to closing the browser, navigating to a new page, or network issues).
Link copied to clipboard
inline suspend fun updateChildren(update: Map<String, Any?>, buildSettings: EncodeSettings.Builder.() -> Unit = {})
Ensure the data has the specified child values updated when the client is disconnected