简体   繁体   中英

Is there way to disable realtime update with Firebase?

I'm using Firebase in my frontend project. More specific I use methods set() and once("value") to change and get data from realtime database table. Now I see in the.network tab of browser Firebase uses websocket connection to the server. But I don't need any realtime updates. Is there way to disable it?

If you only use once() listeners, you already won't receive realtime updates. But Firebase will still use web sockets to communicate between client and server.

If for some reason you don't want to use web sockets, the only way to do so is to call the REST API of Firebase yourself. But you'll lose all benefits of using the SDK, such as its ability to handle loss of connectivity, it retrying of transactions, and more.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM