How to make signalEnumerator(for: identifier) call the relevant enumerateChanges method

216 views Asked by At

In macOS FileProvider extension, when I invoke:

manager.signalEnumerator(for: identifier) { error in
    print("Signal completed with error: \(error)")
}

where identifier is identifier of the relevant folder which contains remote changes, system does NOT call the enumerateChanges method on relevant FileProviderEnumerator.

On other hand if I invoke

manager.signalEnumerator(for: .workingSet) { error in
    print("Signal completed with error: \(error)")
}

there the system properly calls the relevant enumerateChanges method.

Is there a way to make sure that enumerateChanges will be invoked for the provided itemIdentifier? Or is there some explanation as to why the system doesn't call the enumerateChanges method when I provide folder item identifier?

1

There are 1 answers

0
David Kocher On BEST ANSWER

The following note can be found buried in Using push notifications to signal changes

When using an NSFileProviderReplicatedExtension, always set the container identifier to NSFileProviderWorkingSetContainerItemIdentifier. The system automatically propagates any working set changes to the user interface, without requiring you to signal individual containers. It ignores any other identifiers.