feat: update onboarding and application flows
This commit is contained in:
+12
-7
@@ -10,7 +10,7 @@ import { Platform } from 'react-native'
|
||||
const functionsInstances = {}
|
||||
const emulatorConfigured = {}
|
||||
const emulatorHost = Platform.OS === 'web' ? 'localhost' : '192.168.1.60'
|
||||
const USE_FUNCTIONS_EMULATOR = false // Toggle to route functions traffic to the local emulator.
|
||||
const USE_FUNCTIONS_EMULATOR = __DEV__
|
||||
|
||||
const configureFunctionsEmulator = (instance, regionKey = 'us-central1') => {
|
||||
const shouldUseEmulator = USE_FUNCTIONS_EMULATOR && instance?.useEmulator
|
||||
@@ -56,15 +56,20 @@ if (!firebase?.apps?.filter(({ name_ }) => name_ === '[DEFAULT]').length) {
|
||||
console.log('Firebase init')
|
||||
}
|
||||
|
||||
// Firestore settings for React Native/iOS: avoid streaming transport issues
|
||||
const firestore = firebase.firestore()
|
||||
try {
|
||||
// Prefer auto-detect; disable fetch streams for RN iOS stability
|
||||
firebase.firestore().settings({
|
||||
experimentalAutoDetectLongPolling: true,
|
||||
useFetchStreams: false,
|
||||
const firestoreSettings = {
|
||||
ignoreUndefinedProperties: true,
|
||||
})
|
||||
merge: true,
|
||||
}
|
||||
|
||||
// React Native can require long polling, but these settings break web streaming.
|
||||
if (Platform.OS !== 'web') {
|
||||
firestoreSettings.experimentalAutoDetectLongPolling = true
|
||||
firestoreSettings.useFetchStreams = false
|
||||
}
|
||||
|
||||
firestore.settings(firestoreSettings)
|
||||
} catch (e) {
|
||||
// Ignore if settings were already set elsewhere
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user