FirebaseFirestore Framework Reference

FIRSnapshotListenOptions


@interface FIRSnapshotListenOptions : NSObject

Options to configure the behavior of Firestore.addSnapshotListenerWithOptions(). Instances of this class control settings like whether metadata-only changes trigger events and the preferred data source.

  • The source the snapshot listener retrieves data from.

    Declaration

    Objective-C

    @property (nonatomic, readonly) FIRListenSource source;
  • Indicates whether metadata-only changes should trigger snapshot events.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL includeMetadataChanges;
  • Creates and returns a new SnapshotListenOptions object with all properties initialized to their default values.

    Declaration

    Objective-C

    - (nonnull instancetype)init;

    Return Value

    The created SnapshotListenOptions object.

  • Creates and returns a new SnapshotListenOptions object with all properties of the current SnapshotListenOptions object plus the new property specifying whether metadata-only changes should trigger snapshot events

    Declaration

    Objective-C

    - (nonnull FIRSnapshotListenOptions *)optionsWithIncludeMetadataChanges:
        (BOOL)includeMetadataChanges;

    Return Value

    The created SnapshotListenOptions object.

  • Creates and returns a new SnapshotListenOptions object with all properties of the current SnapshotListenOptions object plus the new property specifying the source that the snapshot listener listens to.

    Declaration

    Objective-C

    - (nonnull FIRSnapshotListenOptions *)optionsWithSource:(FIRListenSource)source;

    Return Value

    The created SnapshotListenOptions object.