React-native-firebase: support for firestore online/offline? (info request)

Created on 21 Oct 2017  路  2Comments  路  Source: invertase/react-native-firebase

Can I just check/confirm whether react-native-firebase, used in react-native (for IOS & Android app development) supports online/offline feature mentioned at https://firebase.google.com/docs/firestore/manage-data/enable-offline?

I note the google firestore page it says "Note: Offline persistence is supported only in Android, iOS, and web apps.", and doesn't mention Node or give any node examples (like it does for other features). So questions I guess are:

  1. When looking at google samples for this should I look at the Node example or Web examples for background or none?
  2. Does react-native-firebase support the offline feature? This would imply mean then the react-native-firebase (or the google javascript SDK it includes?) implements/provides "caches a copy of the Cloud Firestore data that your app is actively using, so your app can access the data when the device is offline"
  3. Any example code for using offline features with react-native-firebase?
  4. If it doesn't support it yet any suggestions for starting an app that would ultimately need this? e.g. could start building it with no offline, but in weeks to come react-native-firebase would support this, and it wouldn't be too difficult to migrate to using offline?

thanks

Most helpful comment

Hey Salakar.
I'm looking for disabling 'offline persistence' for my react-native-firestore.
So it's not possible at this time?

All 2 comments

@callagga by default for the native android and iOS SDK's (which we use internally) offline persistence is already pre-enabled, so there's nothing you need to do your end, things will automatically persist / work offline.

1 - Web SDK + we also have reference docs for the API: https://rnfirebase.io/docs/v3.0.*/firestore/reference/firestore
2 - Yes, see first statement.
3 - Code is exactly the same, nothing different needed for offline persistence. We have a walk through on a basic todo app using firestore if it helps: https://medium.com/@elliothesp/b338fb6525b9
4 - N/A

Hey Salakar.
I'm looking for disabling 'offline persistence' for my react-native-firestore.
So it's not possible at this time?

Was this page helpful?
0 / 5 - 0 ratings