I have a problem with Firebase in my React Native app. I've found a quick fix online, but it's written in Firebase Web version 8 syntax:
firebase.firestore().settings({ experimentalForceLongPolling: true, merge: true });
How can I rewrite it in Version 9 syntax?
CodePudding user response:
You need to pass your settings to the initializeFirestore(app, settings)
method.
As you will read on this doc page:
initializeFirestore(app, settings)
initializes a new instance of Firestore with the provided settings. Can only be called before any other function, includinggetFirestore()
. If the custom settings are empty, this function is equivalent to callinggetFirestore()
.