Disconnect programmatically from firebase

885 views Asked by At

How to programmatically disconnect the user?

Here is my problem: I know that the maximum of simultaneous connection is 100 with firebase but in my application, I'm retrieving all the data from the database and then I don't need it anymore so is it possible to disconnect the phone from firebase programmatically?

1

There are 1 answers

0
hd1 On BEST ANSWER

Invoking:

FirebaseDatabase.getInstance().goOffline();

is the way to disconnect the connection from firebase programmatically. Putting the call at the end of your onStart callback is going to be the way to go, from the looks of it. Hope that helps.