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 }
  • Enables the use of FIRTimestamps for timestamp fields in FIRDocumentSnapshots.

    Currently, Firestore returns timestamp fields as an 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.

    Setting timestampsInSnapshotsEnabled to true will cause Firestore to return FIRTimestamp values instead of NSDate, avoiding this kind of problem. To make this work you must also change any code that uses NSDate to use FIRTimestamp instead.

    NOTE: in the future timestampsInSnapshotsEnabled = true will become the default and this option will be removed so you should change your code to use FIRTimestamp now and opt-in to this new behavior as soon as you can.

    Declaration

    Swift

    var areTimestampsInSnapshotsEnabled: Bool { get set }