Open Yonom opened 8 months ago
Hi @Yonom ,
Firestore doesn't support using web SDK as node SDK. Here are some possible workarounds:
The native libraries require use_frameworks which is incompatible with React Native (Flipper, New Architecture/Fabric). I use the JS library for that reason.
This library already supports React Native for firebase/auth, I wish the same support would be extended to firebase/firestore
In the meantime, polyfilling indexdb should do, thanks for the hint
@Yonom can you please share how you will pollyfill for indexdb if you end up doing it? I'm having the same issue trying to get offline persistence for managed expo react native. Considering if i should eject and use react native firebase instead, but it's a big change.
FWIW this is how Firestore does it in its tests: https://github.com/firebase/firebase-js-sdk/blob/master/packages/firestore/test/util/node_persistence.ts. Note that this is NOT officially supported.
Hi @Yonom ,
The ticket has been filed as the feature request for internal tracking (b/320733516). In the meantime, please consider using workarounds suggested above.
@cherylEnkidu what is the process for feature requests? When might we expect to hear if Firebase will be adding support for persistence in tandem with expo/react-native? I see this is a highly requested feature in the community on various threads.
Integration with LokiJS could be a viable option here.
Hi @yanodnoralov ,
There are a lot of factors contributing to feature request prioritization, number of user requesting is definitely one of them. The persistence support for React Native is a big project so in the meanwhile please do consider finding the other workarounds.
Where do vote on this feature request. Its really needed ! specially nowadays you see offline-first apps are everywhere, and they are requested by clients and companies.
Hi @ahmadaIanazi ,
Every time we receive a new reply for the feature request, it will bring to the team discussion to rediscuss the priority. Thank you for reaching out!
All, huge +1 on this. I went into a firebase-react native build under the assumption that what was listed on the firebase official support pages would be reflected in the client libraries. This omission was not documented as far as I could tell. React Native, using JS SDK, is not a small percentage of the apps that are being developed. This seems like a pretty major oversight to me from the Firebase product team.
Operating System
iOS 17.2
Browser Version
React Native
Firebase SDK Version
10.7.1
Firebase SDK Product:
Firestore
Describe your project's tooling
React Native 0.73.2
Describe the problem
On React Native (v0.73.2), enabling persistence for Firestore fails.
Steps and code to reproduce issue