Firestore android sdk cannot reach backend server on android 9 and other versions(android N also)

Viewed 906

App is getting error firestore not able to reach backend, internet is working perfectly (can reach google.com), After searching for solutions I found that there is a option of

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

in firestore js sdk but not in android, Questions:

  1. Is this the right solution
  2. Whats the android equivalent

https://github.com/firebase/firebase-js-sdk/issues/1674

It worked when I changed the network from wifi to cellular, can we achieve this through code, anyhow detect firebase connection is failing then ask user to switch network or programatically change network ?

There exists a unanswered question : Couldn't reach cloud firestore backend Android (21.3.0)

1 Answers
   firebaseApp.firestore().settings({ experimentalForceLongPolling: true });            
   const db=firebaseApp.firestore();

It would resolve the issue.

Related