FIRFirestoreSettings


@interface FIRFirestoreSettings : NSObject <NSCopying>

Settings used to configure a FIRFirestore instance.

  • Creates and returns an empty FIRFirestoreSettings object.

    Declaration

    Objective-C

    - (nonnull instancetype)init;

    Return Value

    The created FIRFirestoreSettings object.

  • The hostname to connect to.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull host;
  • Whether to use SSL when connecting.

    Declaration

    Objective-C

    @property (getter=isSSLEnabled, assign, readwrite, nonatomic) BOOL sslEnabled;
  • A dispatch queue to be used to execute all completion handlers and event handlers. By default, the main queue is used.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic) dispatch_queue_t _Nonnull dispatchQueue;
  • Set to false to disable local persistent storage.

    Declaration

    Objective-C

    @property (getter=isPersistenceEnabled, assign, readwrite, nonatomic)
        BOOL persistenceEnabled;
  • 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

    Objective-C

    @property (getter=areTimestampsInSnapshotsEnabled, assign, readwrite, nonatomic)
        BOOL timestampsInSnapshotsEnabled;
  • 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

    Objective-C

    @property (assign, readwrite, nonatomic) int64_t cacheSizeBytes;