-
Notifications
You must be signed in to change notification settings - Fork 549
FileProvider macOS xcode16.0 b2
Rolf Bjarne Kvinge edited this page Jun 26, 2024
·
5 revisions
#FileProvider.framework
diff -ruN /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDomain.h /Applications/Xcode_16.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDomain.h
--- /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDomain.h 2024-05-30 10:38:20
+++ /Applications/Xcode_16.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDomain.h 2024-06-14 16:37:14
@@ -145,7 +145,9 @@
but doesn't influence where on this volume is the domain going to be stored.
In order to avoid domainID collisions between volumes, the NSFileProviderDomainIdentifier of external domains are generated randomly by FileProvider.
- The provider should therefore use domainUserInfo to associate all necessary information to map the created object to the corresponding account.
+ The provider should therefore use the userInfo to associate all necessary information to map the created object to the corresponding account.
+ The userInfo will be persisted on the volume where the domain was created. If that is an external volume, the userInfo can be used on other devices
+ to assist in setting up the domain on those devices. See the`NSFileProviderExternalVolumeHandling` protocol for more details.
*/
- (instancetype)initWithDisplayName:(NSString *)displayName
userInfo:(NSDictionary *)userInfo
@@ -235,18 +237,19 @@
*/
@property (nonatomic, readonly, nullable) NSData *backingStoreIdentity FILEPROVIDER_API_AVAILABILITY_V4_0_IOS;
-/** If the domain supports syncing the trash.
+/** Whether the domain supports syncing the trash.
- This property only applies for extensions that implement NSFileProviderReplicatedExtension.
+ The system supports syncing a trash folder to the extension.
+ If the domain is configured with supportsSyncingTrash=YES, the system will reparent trashed
+ files (which were located in the extension's domain) to NSFileProviderTrashContainerItemIdentifier.
+ If the domain is configured with supportsSyncingTrash=NO, the system will decide how to handle
+ the trashing operation (not guaranteed by API contract).
- Defaults to YES. Set this to NO to indicate that the domain cannot sync the trash.
- If this property is set to YES the system will move the trashed item to the domain trash.
- If this property is set to NO and the trashed item does not have the NSFileProviderItemCapabilitiesAllowsTrashing capability, the system will offer to permanently delete the item.
- If this property is set to NO and the trashed item does have the NSFileProviderItemCapabilitiesAllowsTrashing capability, then the system will behave differently based on whether the item
- is recursively materialized. If the item is fully materialized, it will be moved to the user's home trash and the operation will look like a delete to the extension.
- If the item is not fully materialized, the system will offer to permanently delete the item.
+ This property is only applicable for NSFileProviderReplicatedExtension-based domains.
+
+ This property defaults to YES.
*/
-@property (readwrite, assign) BOOL supportsSyncingTrash FILEPROVIDER_API_AVAILABILITY_V5_0;
+@property (readwrite, assign) BOOL supportsSyncingTrash API_AVAILABLE(macos(13.0), ios(18.0)) API_UNAVAILABLE(watchos, tvos) API_UNAVAILABLE(macCatalyst);
@property (nonatomic, readonly, nullable) NSUUID *volumeUUID FILEPROVIDER_API_AVAILABILITY_EXTERNAL_VOLUME;
diff -ruN /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderManager.h /Applications/Xcode_16.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderManager.h
--- /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderManager.h 2024-05-30 10:45:21
+++ /Applications/Xcode_16.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderManager.h 2024-06-14 18:35:22
@@ -179,8 +179,9 @@
If the system cannot find a suitable directory, this calls will fail. This could happen e.g. if the domain
does not exist.
- This call will not fail when called from the extension process with an active instance of the extension
- for that domain.
+ This call succeeds when called from the extension process with an instance of the extension for the domain
+ unless domain was disconnected by
+ `-[NSFileProviderExternalVolumeHandling shouldConnectExternalDomainWithCompletionHandler:]`.
*/
- (nullable NSURL *)temporaryDirectoryURLWithError:(NSError **)error FILEPROVIDER_API_AVAILABILITY_V3_IOS;
diff -ruN /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderReplicatedExtension.h /Applications/Xcode_16.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderReplicatedExtension.h
--- /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderReplicatedExtension.h 2024-05-30 05:02:42
+++ /Applications/Xcode_16.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderReplicatedExtension.h 2024-06-14 16:32:03
@@ -234,10 +234,17 @@
- downloads. The system has a per-domain limit on the number of concurrent calls to fetchContents and similar calls.
That limit is configurable by setting the NSExtensionFileProviderDownloadPipelineDepth key to an integer
value (between 1 and 128) in the Info.plist of the extension.
+ The configuration key is honored starting in macOS 11.0 and iOS 16.0.
- uploads. The system has a per-domain limit on the number of concurrent calls to createItemBasedOnTemplate and
- modifyItem when the call includes new content to be uploaded. That limit is configurable by setting the
- NSExtensionFileProviderUploadPipelineDepth key to an integer value (between 1 and 128) in the Info.plist
- of the extension.
+ modifyItem when the call includes new content to be uploaded.
+ That limit is configurable by setting the NSExtensionFileProviderUploadPipelineDepth key to an integer value
+ (between 1 and 128) in the Info.plist of the extension.
+ The configuration key is honored starting in macOS 12.0 and iOS 16.0.
+ - metadata-only uploads. The system has a per-domain limit on the number of concurrent calls to createItemBasedOnTemplate
+ and modifyItem when the call does not include new content to be uploaded.
+ That limit is configurable by setting the NSExtensionFileProviderMetadataOnlyUploadPipelineDepth key to an
+ integer value (between 1 and 128) in the Info.plist of the extension.
+ The configuration key is honored starting in macOS 15.0 and iOS 18.0.
*/
FILEPROVIDER_API_AVAILABILITY_V3_IOS
@protocol NSFileProviderReplicatedExtension <NSObject, NSFileProviderEnumerating>
@@ -1330,6 +1337,29 @@
FILEPROVIDER_API_AVAILABILITY_EXTERNAL_VOLUME
@protocol NSFileProviderExternalVolumeHandling <NSObject>
+/**
+ Implement this protocol on your extension's Principal Class in order for the system
+ to ask your extension whether a domain located on an external volume should be connected.
+
+ Your extension may use this method as an opportunity to check for, and setup if necessary,
+ state to operate the extension. Such as prompting the user to login in your application.
+ When creating domains on external drive, store state related to the domain in the `userInfo` parameter to
+ `-[NSFileProviderDomain initWithDisplayName:userInfo:volumeURL:]`,
+ such as the user's ID, to help your extension identify the domain when connected on other devices. This userInfo will be
+ persisted on the external volume, and provided in the ReplicatedExtension initializer when the drive is connected to a new device.
+
+ If your extension responds with an NSError, the domain will be in a disconnected state. Non-downloaded files
+ in the domain will not be downloadable, and file edits will not be synced up. The system will display
+ UI to inform the user. Your extension will be able to enumerate this domain in
+ `+[NSFileProviderManager getDomainsWithCompletionHandler:]`, with the
+ `-[NSFileProviderDomain disconnected]` property set as YES.
+
+ If at a later point, the user has setup the necessary state to service requests for the disconnected external
+ domain, your extension may call `-[NSFileProviderManager reconnectWithCompletionHandler:]`.
+
+ If your extension does not implement this protocol, domains on external volumes will automatically be
+ connected and instantiated in your extension.
+ */
- (void)shouldConnectExternalDomainWithCompletionHandler:(void (^)(NSError * _Nullable connectionError))completionHandler;
@end