FirebaseFirestore Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
FirestoreSettings
class FirestoreSettings : NSObject, NSCopying
Settings used to configure a Firestore
instance.
-
Creates and returns an empty FirestoreSettings
object.
Return Value
The created FirestoreSettings
object.
-
The hostname to connect to.
Declaration
Swift
var host: String { get set }
-
Whether to use SSL when connecting.
Declaration
Swift
var isSSLEnabled: Bool { get set }
-
A dispatch queue to be used to execute all completion handlers and event handlers. By default,
the main queue is used.
Declaration
Swift
var dispatchQueue: dispatch_queue_t { get set }
-
NOTE: This field will be deprecated in a future major release. Use the cacheSettings
field
instead to specify cache type, and other cache configurations.
Set to false to disable local persistent storage.
Declaration
Swift
var isPersistenceEnabled: Bool { get set }
-
NOTE: This field will be deprecated in a future major release. Use the cacheSettings
field
instead to specify cache size, and other cache configurations.
Sets the cache size threshold above which the SDK will attempt to collect least-recently-used
documents. The size is not a guarantee that the cache will stay below that size, only that if
the cache exceeds the given size, cleanup will be attempted. Cannot be set lower than 1MB.
Set to FirestoreCacheSizeUnlimited
to disable garbage collection entirely.
Declaration
Swift
var cacheSizeBytes: Int64 { get set }
-
Declaration
Swift
var cacheSettings: any NSObjectProtocol & FIRLocalCacheSettings { get set }
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-03-11 UTC.
[null,null,["Last updated 2025-03-11 UTC."],[],[],null,["FirestoreSettings \n\n class FirestoreSettings : NSObject, NSCopying\n\nSettings used to configure a [Firestore](../Classes/Firestore.html) instance.\n- `\n ``\n ``\n `\n\n [init()](#/c:objc(cs)FIRFirestoreSettings(im)init)`\n ` \n Creates and returns an empty `FirestoreSettings` object. \n\n Declaration \n Swift \n\n init()\n\n Return Value\n\n The created `FirestoreSettings` object.\n- `\n ``\n ``\n `\n\n [host](#/c:objc(cs)FIRFirestoreSettings(py)host)`\n ` \n The hostname to connect to. \n\n Declaration \n Swift \n\n var host: String { get set }\n\n- `\n ``\n ``\n `\n\n [isSSLEnabled](#/c:objc(cs)FIRFirestoreSettings(py)sslEnabled)`\n ` \n Whether to use SSL when connecting. \n\n Declaration \n Swift \n\n var isSSLEnabled: Bool { get set }\n\n- `\n ``\n ``\n `\n\n [dispatchQueue](#/c:objc(cs)FIRFirestoreSettings(py)dispatchQueue)`\n ` \n A dispatch queue to be used to execute all completion handlers and event handlers. By default,\n the main queue is used. \n\n Declaration \n Swift \n\n var dispatchQueue: dispatch_queue_t { get set }\n\n- `\n ``\n ``\n `\n\n [isPersistenceEnabled](#/c:objc(cs)FIRFirestoreSettings(py)persistenceEnabled)`\n ` \n Deprecated\n\n This field is deprecated. Use [cacheSettings](../Classes/FirestoreSettings.html#/c:objc(cs)FIRFirestoreSettings(py)cacheSettings) instead. \n NOTE: This field will be deprecated in a future major release. Use the [cacheSettings](../Classes/FirestoreSettings.html#/c:objc(cs)FIRFirestoreSettings(py)cacheSettings) field\n instead to specify cache type, and other cache configurations.\n\n Set to false to disable local persistent storage. \n\n Declaration \n Swift \n\n var isPersistenceEnabled: Bool { get set }\n\n- `\n ``\n ``\n `\n\n [cacheSizeBytes](#/c:objc(cs)FIRFirestoreSettings(py)cacheSizeBytes)`\n ` \n Deprecated\n\n This field is deprecated. Use [cacheSettings](../Classes/FirestoreSettings.html#/c:objc(cs)FIRFirestoreSettings(py)cacheSettings) instead. \n NOTE: This field will be deprecated in a future major release. Use the [cacheSettings](../Classes/FirestoreSettings.html#/c:objc(cs)FIRFirestoreSettings(py)cacheSettings) field\n instead to specify cache size, and other cache configurations.\n\n Sets the cache size threshold above which the SDK will attempt to collect least-recently-used\n documents. The size is not a guarantee that the cache will stay below that size, only that if\n the cache exceeds the given size, cleanup will be attempted. Cannot be set lower than 1MB.\n\n Set to [FirestoreCacheSizeUnlimited](../Constants.html#/c:@kFIRFirestoreCacheSizeUnlimited) to disable garbage collection entirely. \n\n Declaration \n Swift \n\n var cacheSizeBytes: Int64 { get set }\n\n- `\n ``\n ``\n `\n\n [cacheSettings](#/c:objc(cs)FIRFirestoreSettings(py)cacheSettings)`\n ` \n Specifies the cache used by the SDK. Available options are [PersistentCacheSettings](../Classes/PersistentCacheSettings.html)\n and [MemoryCacheSettings](../Classes/MemoryCacheSettings.html), each with different configuration options.\n\n When unspecified, [PersistentCacheSettings](../Classes/PersistentCacheSettings.html) will be used by default.\n\n NOTE: setting this field and [cacheSizeBytes](../Classes/FirestoreSettings.html#/c:objc(cs)FIRFirestoreSettings(py)cacheSizeBytes) or `persistenceEnabled` at the same time will throw\n an exception during SDK initialization. Instead, use the configuration in\n the [PersistentCacheSettings](../Classes/PersistentCacheSettings.html) object to specify the cache size. \n\n Declaration \n Swift \n\n var cacheSettings: any NSObjectProtocol & FIRLocalCacheSettings { get set }"]]