Disconnect programmatically from firebase

*爱你&永不变心* 提交于 2020-06-01 09:36:23

问题


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:


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.



来源:https://stackoverflow.com/questions/55082035/disconnect-programmatically-from-firebase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!