java.lang.Object | |
↳ | com.google.firebase.database.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 onDisconnect
on a Firebase Database ref.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Cancel any disconnect operations that are queued up at this location
| |||||||||||
Cancel any disconnect operations that are queued up at this location
| |||||||||||
Remove the value at this location when the client disconnects
| |||||||||||
Remove the value at this location when the client disconnects
| |||||||||||
Ensure the data at this location is set to the specified value and priority when the client is
disconnected (due to closing the browser, navigating to a new page, or network issues).
| |||||||||||
Ensure the data at this location is set to the specified value and priority when the client is
disconnected (due to closing the browser, navigating to a new page, or network issues).
| |||||||||||
Ensure the data at this location is set to the specified value and priority when the client is
disconnected (due to closing the browser, navigating to a new page, or network issues).
| |||||||||||
Ensure the data at this location is set to the specified value and priority when the client is
disconnected (due to closing the browser, navigating to a new page, or network issues).
| |||||||||||
Ensure the data at this location is set to the specified value and priority when the client is
disconnected (due to closing the browser, navigating to a new page, or network issues).
| |||||||||||
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).
| |||||||||||
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).
| |||||||||||
Ensure the data has the specified child values updated when the client is disconnected
| |||||||||||
Ensure the data has the specified child values updated when the client is disconnected
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Cancel any disconnect operations that are queued up at this location
Parameters | |
---|---|
listener |
DatabaseReference.CompletionListener :
A listener that will be triggered once the server has cancelled the operations
|
Remove the value at this location when the client disconnects
Parameters | |
---|---|
listener |
DatabaseReference.CompletionListener :
A listener that will be triggered once the server has queued up the operation
|
Ensure the data at this location is set to the specified value and priority when the client is
disconnected (due to closing the browser, navigating to a new page, or network issues).
This method is especially useful for implementing "presence" systems, where a value should be
changed or cleared when a user disconnects so that they appear "offline" to other users.
Parameters | |
---|---|
value |
Object :
The value to be set when a disconnect occurs |
priority |
double :
The priority to be set when a disconnect occurs |
listener |
DatabaseReference.CompletionListener :
A listener that will be triggered once the server has queued up the operation
|
Ensure the data at this location is set to the specified value and priority when the client is
disconnected (due to closing the browser, navigating to a new page, or network issues).
This method is especially useful for implementing "presence" systems, where a value should be
changed or cleared when a user disconnects so that they appear "offline" to other users.
Parameters | |
---|---|
value |
Object :
The value to be set when a disconnect occurs |
priority |
Map :
The priority to be set when a disconnect occurs |
listener |
DatabaseReference.CompletionListener :
A listener that will be triggered once the server has queued up the operation
|
Ensure the data at this location is set to the specified value and priority when the client is
disconnected (due to closing the browser, navigating to a new page, or network issues).
This method is especially useful for implementing "presence" systems, where a value should be
changed or cleared when a user disconnects so that they appear "offline" to other users.
Parameters | |
---|---|
value |
Object :
The value to be set when a disconnect occurs |
priority |
String :
The priority to be set when a disconnect occurs |
Returns | |
---|---|
Task<Void> |
The Task for this operation.
|
Ensure the data at this location is set to the specified value and priority when the client is
disconnected (due to closing the browser, navigating to a new page, or network issues).
This method is especially useful for implementing "presence" systems, where a value should be
changed or cleared when a user disconnects so that they appear "offline" to other users.
Parameters | |
---|---|
value |
Object :
The value to be set when a disconnect occurs |
priority |
double :
The priority to be set when a disconnect occurs |
Returns | |
---|---|
Task<Void> |
The Task for this operation.
|
Ensure the data at this location is set to the specified value and priority when the client is
disconnected (due to closing the browser, navigating to a new page, or network issues).
This method is especially useful for implementing "presence" systems, where a value should be
changed or cleared when a user disconnects so that they appear "offline" to other users.
Parameters | |
---|---|
value |
Object :
The value to be set when a disconnect occurs |
priority |
String :
The priority to be set when a disconnect occurs |
listener |
DatabaseReference.CompletionListener :
A listener that will be triggered once the server has queued up the operation
|
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).
This method is especially useful for implementing "presence" systems, where a value should be
changed or cleared when a user disconnects so that they appear "offline" to other users.
Parameters | |
---|---|
value |
Object :
The value to be set when a disconnect occurs |
listener |
DatabaseReference.CompletionListener :
A listener that will be triggered once the server has queued up the operation
|
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).
This method is especially useful for implementing "presence" systems, where a value should be
changed or cleared when a user disconnects so that they appear "offline" to other users.
Parameters | |
---|---|
value |
Object :
The value to be set when a disconnect occurs |
Returns | |
---|---|
Task<Void> |
The Task for this operation.
|
Ensure the data has the specified child values updated when the client is disconnected
Parameters | |
---|---|
update |
Map :
The paths to update, along with their desired values |
listener |
DatabaseReference.CompletionListener :
A listener that will be triggered once the server has queued up the operation
|