Skip to content
Advertisement

Rewrite this Firebase Web SDK Version 8 syntax into Version 9

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?

Advertisement

Answer

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().

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement