Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Offline persistence - how to always store specific collection on the device? #3080

Unanswered
Namennaj asked this question in Q&A
Discussion options

I am trying to build an app that will mostly be used offline (only internet access is at home), the moment you go out in the field there is no internet access. The idea is that the user collects the data out in the field, and tonight when he is home the data sync with Firestore. This data can work with the cache method. (Meaning you have to first request the data while you have an internet connection before you can access it offline.)

However, the app has a second feature with information that should always be on the app. Meaning, the moment you install the app, the data from this specific collection should be downloaded to the device. And whenever you open the app with an internet connection the latest version of this collection should be stored on the device.

Can this be set with AngularFire?

(For reference I am building the App with Ionic + Capacitor + Angular.)

You must be logged in to vote

Replies: 1 comment

Comment options

Yes, with AngularFire you can persist data locally.

You can use the enablePersistence() method in the constructor of your app.module.ts file to enable offline data persistence in AngularFire. When the device is offline, this will enable your app to access previously accessible data from the cache.

Check out this link.

"Offline persistence is an experimental feature that is supported only by the Chrome, Safari, and Firefox web browsers. If a user opens multiple browser tabs that point to the same Cloud Firestore database, and offline persistence is enabled, Cloud Firestore will work correctly only in the first tab."

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /