简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM