离线/科尔多瓦的Firebase离线功能 [英] Firebase offline capabilities in ionic / cordova

查看:155
本文介绍了离线/科尔多瓦的Firebase离线功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人在Android / iOS上实现了一个带有完整离线功能的Firebase原生应用程序?



这可以通过使用本地Firebase SDK的Cordova / Ionic完成吗?



构建一个在下载和首次启动时有连接的应用程序,但是我们不得不假定一段时间内没有更多的互联网连接,并且数据库中的所有内容都必须可以脱机使用。 Firebase是否适合这个需求,或者我们必须使用CouchDB / PouchDB还是其他的替代方法?

可以使用以下项目 -
AngularFire2-离线



它的目的是启用支持浏览器的离线数据访问(支持服务人员) -
支持服务人员的浏览器(和匹配版本)列表



这样工作 -




  • 在线时,Firebase数据存储在本地(当数据发生更改时,本地存储更新)
  • 离线时提供本地数据写入存储在本地

  • 在重新连接时,使用新的Firebase数据进行应用更新,并将写入内容发送到Firebase 使用本地数据第一当可用时导致更快的加载


  • Has anybody implemented a native app with Firebase with full offline capabilities in Android/iOS?

    Could this be done in Cordova/Ionic with a plugin that uses the native Firebase SDKs?

    We are building an app that has connection at download and first start but then we have to assume there is no more internet connection for a while and all content from the database has to be available offline. Is Firebase suitable for this requirement or do we have to use CouchDB/PouchDB or any other alternative?

    解决方案

    You can use the following project - AngularFire2-offline

    It's purpose is to enable offline data access for supporting browsers (that supports service workers) - List of browsers (and matching versions) that support service workers

    It works this way -

    • While online, Firebase data is stored locally (as data changes the local store is updated)
    • While offline, local data is served if available, and writes are stored locally
    • On reconnect, app updates with new Firebase data, and writes are sent to Firebase
    • Even while online, local data is used first when available which results in a faster load

    这篇关于离线/科尔多瓦的Firebase离线功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆