Does Firebase allow an app to start in offline mode?

eug picture eug · Feb 3, 2013 · Viewed 15.3k times · Source

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.

Answer

Andrew Lee picture Andrew Lee · Feb 3, 2013

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