React-native-firebase: Cloud firestore session persistence

Created on 5 Dec 2018  路  7Comments  路  Source: invertase/react-native-firebase

Issue

I am trying to enable persistence for specific cloud firestore collections so that when the app is closed and then reopened I do not need to load the data directly from Firebase again.

(Much like authentication in the app with no network connection)


Use case

I have a collection called 'users-info' that holds details such as Firstname and Avatar. When the app is opened with no network connection the user is authenticated and can see their profile with the user-info doc for their account.

Is this possible using react-native-firebase?

Many thanks :+1:


Think react-native-firebase is great? Please consider supporting the project with any of the below:

Firestore 馃搶 pin

Most helpful comment

any updates?

All 7 comments

+1, I would also like to know this!

@visagegod any update on this?

Hello 馃憢, this issue has been automatically marked as stale because it has not had activity for quite some time. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

any updates?

Unfortunately the only reference I can find to persistence is for the entire app, which is currently exposed (link). Looks like it isn't possible for specific collections I'm afraid.

@Ehesp . Is offline persistence enables on cloud firestore with react native?

@Ehesp: Those linked docs (https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/FirebaseFirestoreSettings.Builder.html#setPersistenceEnabled(boolean)) say this is enabled by default, but that doesn't seem to be the case in react-native-firebase@6.

Is it expected to be on?

Was this page helpful?
0 / 5 - 0 ratings