1
votes

I was using Firestore through the Firebase Javascript SDK in my react-native app using expo, but after ejecting from expo I get this error even though my device is connected to the internet:

@firebase/firestore: Firestore (7.19.1): Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds.
This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.

How would I fix this, or should I just use the react-native-firebase package?

1
I am having the same issue. - Cold Cerberus
@ColdCerberus try adding firebase.firestore().settings({experimentalForceLongPolling: true}) to your firebase config.js - M. Alex

1 Answers

2
votes

I was able to fix this by adding this line at the bottom of my firebase config.js:

export const firebase = Firebase.initializeApp(firebaseConfig);
firebase.firestore().settings({experimentalForceLongPolling: true}); // add this

Now firestore works as expected for me