FirestoreSettings

class FirestoreSettings : NSObject, NSCopying

Settings used to configure a FIRFirestore instance.

  • Creates and returns an empty FIRFirestoreSettings object.

    Declaration

    Swift

    init()

    Return Value

    The created FIRFirestoreSettings 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: DispatchQueue { get set }
  • Set to false to disable local persistent storage.

    Declaration

    Swift

    var isPersistenceEnabled: Bool { get set }
  • Specifies whether to use FIRTimestamps for timestamp fields in FIRDocumentSnapshots. This is now enabled by default and should not be disabled.

    Previously, Firestore returned timestamp fields as NSDate but NSDate is implemented as a double which loses precision and causes unexpected behavior when using a timestamp from a snapshot as a part of a subsequent query.

    So now Firestore returns FIRTimestamp values instead of NSDate, avoiding this kind of problem.

    To opt into the old behavior of returning NSDate objects, you can temporarily set areTimestampsInSnapshotsEnabled to false.

    @deprecated This setting now defaults to true and will be removed in a future release. If you are already setting it to true, just remove the setting. If you are setting it to false, you should update your code to expect FIRTimestamp objects instead of NSDate and then remove the setting.

    Declaration

    Swift

    var areTimestampsInSnapshotsEnabled: Bool { get set }
  • 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 kFIRFirestoreCacheSizeUnlimited to disable garbage collection entirely.

    Declaration

    Swift

    var cacheSizeBytes: Int64 { get set }