'@firebase/firestore: Firestore (8.6.3): Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds

I am working on react-native app, i couldn't able to connect firebase with react-native.

 @firebase/firestore: Firestore (8.6.3): 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. 

please someone help me on this issue.



Solution 1:[1]

Change from

// firebase-config.js
import { getFirestore } from 'firebase/firestore';

const db = getFirestore(app);

to

// firebase-config.js
import { initializeFirestore } from 'firebase/firestore'

const database = initializeFirestore(app, {
  experimentalAutoDetectLongPolling: true
})

This should solve the issue.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pawan Kumar