简体   繁体   English

解决Ionic 4 / Firebase断开连接的最佳方法是什么

[英]What is the best way to handle disconnect for Ionic 4/Firebase

I am running and developing an Ionic 4 application but I get plenty of console errors if the enable Disconnect on Chrome developer tools. 我正在运行和开发Ionic 4应用程序,但是如果在Chrome开发人员工具上启用了“断开连接”,则会收到大量控制台错误。 What is the best way to handle this and stop the error generations? 解决此问题并停止错误生成的最佳方法是什么?

[Edit] - Some errors [编辑]-一些错误

zone.js:3243 POST https://firestore.googleapis.com/google.firestore.v1.Firestore/Listen/channel?database=projects%9e%2Fdatabases%2F(default)&VER=8&gsessionid=zS_Z186jbzIduyA8czPUNKQ3nDUeAStV&SID=6_aGSsvm--uKTRwIw6hLjQ&RID=45854&AID=18&zx=fotdumdzihh5&t=1 net::ERR_INTERNET_DISCONNECTED

zone.js:3243 POST https://firestore.googleapis.com/google.firestore.v1.Firestore/Listen/channel?database=projects%89e%2Fdatabases%2F(default)&VER=8&gsessionid=zS_Z186jbzIduyA8czPUNKQ3nDUeAStV&SID=6_aGSsvm--uKTRwIw6hLjQ&RID=45854&AID=18&zx=6g8tdtpwagpv&t=2 net::ERR_INTERNET_DISCONNECTED

www.google.com/images/cleardot.gif?zx=k0fhnf17yuw:1 GET https://www.google.com/images/cleardot.gif?xxw net::ERR_INTERNET_DISCONNECTED

I had a similar issue with Firebase realtime database, where once the app goes offline there was a console log spam (caused by fb attempting to establish connection), where I had to use .goOffline() method provided by the SDK to prevent it. 我在Firebase实时数据库中遇到了类似的问题,即该应用程序离线后,就会出现控制台日志垃圾邮件(由fb试图建立连接引起),在该应用程序中,我必须使用SDK提供的.goOffline()方法来阻止它。

With Firestore SDK there are similar methods: 使用Firestore SDK,有类似的方法:

Which you could call programmatically in the online/offline network listener callback. 您可以在联机/脱机网络侦听器回调中以编程方式进行调用。 If you can share your particular implementation I could help you show how. 如果您可以共享您的特定实现,那么我可以帮助您展示如何实现。

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

相关问题 将通知用户发送到用户ionic 3 / firebase的最佳方法是什么 - What is the best way to send notification user to user ionic 3 / firebase 跨Ionic标签管理Firebase用户的最佳方法是什么 - What is the best way to manage Firebase user across Ionic Tabs 将Ionic 2 Nativ Facebook与Firebase连接的最佳方法 - Best way to connect ionic 2 nativ facebook with firebase 用离子写代码的最佳方法是什么 - what is the best way to write the code in ionic 什么是在Ionic中检查互联网连接的最佳方式 - What is the Best way to check internet connection in Ionic 在Ionic中处理用户身份验证+推送通知的最佳方法 - Best way to handle User authentication + Push Notifiations in Ionic 在 Angular 4 中处理对象的最佳方法是什么 - What is the best way to handle an object of objects in Angular 4 离子应用程序代码可以拆分的最佳方式是什么? - What is the best way in which ionic application code can be split? 如何在 Ionic 4 中使用 Firebase 处理刷新令牌? - How to handle refresh token with Firebase in Ionic 4? 将多个用户图像上传到 Firestore 集合的最佳方式是什么? 使用 Angular/Ionic 4 - What is the best way to upload multiple user images to a firestore collection? using Angular/Ionic 4
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM