Home > Net >  Rewrite this Firebase Web SDK Version 8 syntax into Version 9
Rewrite this Firebase Web SDK Version 8 syntax into Version 9

Time:10-30

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, including getFirestore(). If the custom settings are empty, this function is equivalent to calling getFirestore().

  • Related