简体   繁体   English

有没有办法用 Firebase 禁用实时更新?

[英]Is there way to disable realtime update with Firebase?

I'm using Firebase in my frontend project.我在我的前端项目中使用 Firebase。 More specific I use methods set() and once("value") to change and get data from realtime database table.更具体地说,我使用方法 set() 和 once("value") 来更改实时数据库表并从中获取数据。 Now I see in the.network tab of browser Firebase uses websocket connection to the server.现在我在浏览器的 .network 选项卡中看到 Firebase 使用 websocket 连接到服务器。 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.如果您只使用once()侦听器,您将不会收到实时更新。 But Firebase will still use web sockets to communicate between client and server.但是 Firebase 仍然会使用 web sockets 在客户端和服务器之间进行通信。

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.如果出于某种原因您不想使用 web sockets,唯一的方法是自己拨打 Firebase 的 REST API。 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.但是您将失去使用 SDK 的所有好处,例如处理连接丢失的能力、重试交易等。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Firebase 实时数据库更新子 - Firebase realtime DB update child 一旦我的 firebase 实时数据库获得更多数据,有没有办法更新所有活动网页? - Is there a way to update all active webpages once my firebase Realtime database gains more data? Flutter Firebase 实时数据库 StreamBuilder 更新 - Flutter Firebase Realtime Database StreamBuilder update 无法使用 Flutter 更新 Firebase 实时数据库中的值 - Unable to update value in Firebase Realtime Database with Flutter 如何使用 Firebase 9(模块化 sdk)更新 Firebase 实时数据库中的数据 - How to update data in Firebase realtime database using Firebase 9 (modular sdk) 将新属性更新到现有节点 firebase(实时数据库) - update new attribute into exists node firebase(realtime database) Firebase 实时数据库订阅在 Xamarin Forms 中没有插入/更新时触发 - Firebase Realtime Database subscribe fires Without Insert/Update in Xamarin Forms 有没有办法为所有 firebase 安全规则添加附加限制(不是一一添加)? 通过更新禁用用户的替代解决方案 - Is there a way to add an aditional restriction to all firebase security rules (not one by one)? Alternative solution to disable users with an update 如何更新 firebase 实时数据库 (JavaScript) 中键的值 - How to update the value of a key in firebase Realtime database (JavaScript) Firebase 实时数据库多文档更新失败 - Firebase Realtime DB multi-document update failing
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM