Post

Replies

Boosts

Views

Activity

How to avoid "Application would like to access files on network volume" prompt on macOS?
So here is my situation. I am developing a macOS app which includes a helper tool. Helper mounts a FS (served locally from the app) under /Volumes/myfilesystem. Once this happens I would like the main app to programmaticaly open a finder window on the root of this filesystem. I'm currently trying to do this like that: configuration: conf) Unfortunately this causes the interactive security prompt to popup for the user (even though I "disallow" the access the Finder window correctly opens on the given directroy). Is there a way to avoid this popup (I don't want to "access" this directory" from my app, I just need it to open it in Finder)?
4
0
1.6k
Mar ’21
Problem starting a macOS file provider extension
Hi, I'm trying to get to the point when the code of my file provider extension gets executed. As there is no Xcode template for macOS file provider extension target, I've created a FinderSync extension and updated its Info.plist NSExtension entry manually: <key>NSExtension</key> <dict> <key>NSExtensionFileProviderDocumentGroup</key> <string>$(TeamIdentifierPrefix)group.xxxx.test-placeholders</string> <key>NSExtensionFileProviderEnabledByDefault</key> <true/> <key>NSExtensionFileProviderSupportsEnumeration</key> <true/> <key>NSExtensionPointIdentifier</key> <string>com.apple.fileprovider-nonui</string> <key>NSExtensionPrincipalClass</key> <string>FakeProvider</string> </dict> I use my main app to "bootstrap" the provider (i.e. to register a domain for file provider and trigger enumeration), i.e.: let domainID = NSFileProviderDomainIdentifier(rawValue: "blahblahblah") let domain = NSFileProviderDomain(identifier: domainID, displayName: "My Secret Files") NSFileProviderManager.add(domain) { (err) in &#9;if let err = err { &#9;&#9;/* handle error */ &#9;} else { &#9;&#9; let mgr = NSFileProviderManager(for: domain) &#9;&#9; mgr?.signalEnumerator(for: .rootContainer) { &#9;&#9;&#9; err in &#9;&#9;&#9; /* handle error if any */ &#9;&#9; } &#9;} } I have limited success with this approach. My extension is visible in macOS Preferences -> Extensions. Finder shows newly registered domain under Locations, but it's not able to enumerate it (there is a spinner for some time and then it fails with an error). FakeProvider inherits from NSObject and implements NSFileProviderReplicatedExtension and NSFileProviderEnumerating protocols. The implementation just tries to log the fact of being called (both using USL and NSLog) and calls callback closures with nils whenever needed. It looks to me that none of this logging code gets executed (I see none of this text in Console.app). What happens is that my call to signalEnumerator times out with the following error message: error=Optional(Error Domain=NSCocoaErrorDomain Code=4101 "Couldn’t communicate with a helper application." UserInfo={NSUnderlyingError=0x60000125c1e0 {Error Domain=NSFileProviderInternalErrorDomain Code=7 "A connection to the extension “xxxx.test-placeholders.olamakota” could not be made." UserInfo={NSLocalizedDescription=A connection to the extension “xxxx.test-placeholders.olamakota” could not be made., NSUnderlyingError=0x60000125c240 {Error Domain=NSCocoaErrorDomain Code=4097 "connection to service on pid 0 named xxxx.olamakota.apple-extension-service" UserInfo={NSDebugDescription=connection to service on pid 0 named xxxx.test-placeholders.olamakota.apple-extension-service}}}}}) additionally there is a lot of system.log entries like: Jan 19 10:41:44 mbpro com.apple.xpc.launchd[1] (xxxx.test-placeholders.olamakota[2324]): Extension is hanging on launch. Killing. Jan 19 10:41:44 mbpro com.apple.xpc.launchd[1] (xxxx.test-placeholders.olamakota[2324]): Extension did not initialize in time. Jan 19 10:41:51 mbpro com.apple.xpc.launchd[1] (com.apple.applefsplaceholder): Service only ran for 0 seconds. Pushing respawn out by 10 seconds. Those errors suggest that there is a problem in extension initialization, but are not verbose enough to actually be of any help in finding a problem. Official documentation on creating file providers on macOS is also not helpful - it gives no hint how file provider extensions should be initialized and/or registered in the system. Did anyone had successfully developed a file provider extension for a Mac? Have you got to the point when the code in your extensions gets executed? Also maybe you can share some ideas on how to debug this situation?
4
0
4.2k
Jan ’21