Firebase ( Firestore ) problem

I make one hybride app for IOS . I use Framework7 with Cordova. If I use only Cordova, it can reach my firestore. But if I use Cordova + Framework7 CLI, it can’t see firestore.

In Xcode, I see this fault.

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

Here is rules.

service cloud.firestore {
  match /databases/{database}/documents {

    // This rule allows anyone on the internet to view, edit, and delete
    // all data in your Firestore database. It is useful for getting
    // started, but it is configured to expire after 30 days because it
    // leaves your app open to attackers. At that time, all client
    // requests to your Firestore database will be denied.
    //
    // Make sure to write security rules for your app before that time, or else
    // your app will lose access to your Firestore database
    match /{document=**} {
      allow read, write;
    }
  }
}

Here is one screenshot.


What is problem?

Can you help, please ?

Thank you.

I also have this problem. Works correctly in a browser. Same timeout issue when I build the app.

I now have a working solution for anyone who see this. Be sure to set the following where you initialize.

firebase.firestore().settings({ experimentalForceLongPolling: true });

3 Likes

Firebase is collecting feedback on this setting, I suggest marking that this fixed this issue for you on this thread so that they know that people are using it: https://github.com/firebase/firebase-js-sdk/issues/1674

1 Like

njvan,

thank you for this solution.

Dmitry

1 Like

Thanks this helped us out of a jam where a companies security settings was throttling the firestore calls!!

1 Like

You saved my day.
Thanks!

1 Like

Hi, Im trying to use your solution but when I use .settings({here the settings}) my fireStore object becomes undefined!

Hi, Im trying to use your solution but when I use .settings({here the settings}) my fireStore object becomes undefined!

Be aware that the solution here was posted two years ago. The Firebase SDK continues to evolve, and you should always check Google’s Firebase documentation for the most up-to-date usage.

1 Like

Can you provide more code?