Post

Replies

Boosts

Views

Activity

Reply to Problem starting a macOS file provider extension
If your are using Swift, then you must also include module name when you specify the principal class in the info.plist like this: <key>NSExtensionPrincipalClass</key> <string>$(PRODUCT_MODULE_NAME).FileProvider</string> I also did what you described above and it works for me: https://developer.apple.com/forums/thread/122351?answerId=645095022#645095022
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’21
Reply to Cannot launch new FileProvider extension on macOS 10.15
I managed to get the File Provider extension working with some tricks with Xcode 12.2 RC (Version 12.2 beta 4 (12B5044c)) and macOS 11.0.1 RC (Version 11.0.1 Beta (20B5022a)) You cannot add a File Provider Extension target in Xcode (FB8889071). However it can be worked around by adding a different extension target then modifying the info.plist file accordingly. E.g. I added a Finder Sync Extension then modified the NSExtension part of the info.plist similar to an iOS File Provider Extension: <key>NSExtension</key> <dict> <key>NSExtensionFileProviderDocumentGroup</key> <string>group.com.yourappgroup</string> <key>NSExtensionFileProviderSupportsEnumeration</key> <true/> <key>NSExtensionPointIdentifier</key> <string>com.apple.fileprovider-nonui</string> <key>NSExtensionPrincipalClass</key> <string>$(PRODUCT_MODULE_NAME).FileProvider</string> </dict> I’m not sure if all these keys are needed, but I guess the NSExtensionPointIdentifier and NSExtensionPrincipalClass must be set. The NSExtensionPrincipalClass value must be set to the class that implements the NSFileProviderReplicatedExtension protocol in your extension target. Then in my app I do the following after launch to set up a file provider: let domain = NSFileProviderDomain(identifier: NSFileProviderDomainIdentifier("com.myapp.fileprovider"), displayName: "MyAppFileProvider") NSFileProviderManager.add(domain) { error in &#9;&#9;print("Add file provider domain: \(error as NSError?)") &#9;&#9;let manager = NSFileProviderManager(for: domain) &#9;&#9;manager?.signalEnumerator(for: .rootContainer, completionHandler: { error in &#9;&#9;&#9;&#9;print("Signal change error: \(error as NSError?)") &#9;&#9;}) } This will add the file provider to the sidebar in Finder. I got this so far, can enumerate items similar to iOS file provider. The way the File Provider Extension should be set up, and how we should work with it is still lacking documentation and an example project.
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’20