Created
January 22, 2018 16:03
-
-
Save wajahatkarim3/85def65f3b5b1e71a0d7b879cbaf1628 to your computer and use it in GitHub Desktop.
The onDisconnect() hook to make user offline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun makeUserOnline(user: UserModel) | |
{ | |
// Adding on disconnect hook | |
FirebaseDatabase.getInstance().getReference("/status/" + user.userId) | |
.onDisconnect() // Set up the disconnect hook | |
.setValue("offline"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment