2

I looking for ideas how to implement a local backup of Firebase data on an users device for Cordova/PhoneGap apps.

So if an app is shut down, updated etc. the data can be booted from there.

There is one approach using local storage: https://github.com/yeldarby/offline-firebase

However I prefer not to override Firebase code, and to save data more persistently. Either written to a file via the Cordova file api, or via the SQLite Database plugin for Cordova/PhoneGap.

What is the best way to listen to changes on the Firebase data via AngularFire? So I could react on it an save it along with the Firebase object keys etc.

And, Is there even a way to physically save pending local events?

Related: Firebase offline storage with Phonegap

Community
  • 1
  • 1
Stefan
  • 51
  • 6
  • Why listen for changes on AngularFire instead of the Firebase SDK? AngularFire is a bindings library for synchronizing data between Angular views and Firebase, not suitable for implementing your own offline persistence lib. – Kato Aug 12 '14 at 05:40
  • Hi Kato. Yes you are right. The [on()](https://www.firebase.com/docs/web/api/query/on.html) method seems the right way to listen for changes. – Stefan Aug 12 '14 at 06:53

0 Answers0