[英]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.