Firebase是否允许应用以离线模式启动? [英] Does Firebase allow an app to start in offline mode?

查看:156
本文介绍了Firebase是否允许应用以离线模式启动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑使用firebase编写一个使用PhoneGap和HTML5应用程序缓存的移动应用程序。

让我们假设每个用户都有一个TODO项目列表。如果应用程序在电话处于脱机状态时启动,是否能够加载前一个会话中的数据并在建立连接时进行同步?如果是的话,我想知道这是如何实现的,因为我无法在firebase.js中找到对localStorage的引用。

解决方案

简单的答案是:还没有。

一旦一个应用程序连接到Firebase,客户端将在本地缓存数据,并能够访问有突出的on 即使在网络连接丢失之后,回叫也是如此。但是,这些数据并没有保存到磁盘上,离线模式只能在应用程序运行时才能正常工作。



将来会提供完整的离线支持。 .com / blog / 2015-05-29-announcing-mobile-offline-support.htmlrel =noreferrer> https://www.firebase.com/blog/2015-05-29-announcing-mobile-offline -support.html


I'm thinking of using firebase to write a mobile app using PhoneGap and the HTML5 Application Cache.

Lets suppose each user has a list of TODO items. If the app is started when the phone is offline, will it be able to load data from the previous session and sync when a connection is established? If so I'm wondering how this is implemented because I couldn't find a reference to localStorage in firebase.js.

解决方案

The short answer is: not yet.

Once an app has connected to Firebase, the client will cache data locally and be able to access data where there is an outstanding "on" callback even after a network connection is lost. However, this data is not persisted to disk, the "offline mode" will only work while the app is still running.

Full offline support will be coming in the future.

edit 2016 : full offline support is now possible for native iOS and Android apps: https://www.firebase.com/blog/2015-05-29-announcing-mobile-offline-support.html

这篇关于Firebase是否允许应用以离线模式启动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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