File Provider

RSS for tag

Allow other apps to access the documents and directories stored and managed by your containing app using File Provider.

File Provider Documentation

Pinned Posts

Posts under File Provider tag

88 Posts
Sort by:
Post not yet marked as solved
0 Replies
50 Views
Description says this event will be raised when "An identifier for a process that notifies endpoint security that it is updating a file." What does this mean ? Similarly when will ES_EVENT_TYPE_NOTIFY_FILE_PROVIDER_MATERIALIZE event be raised ? Do these events get raised if any cloud provider sync app like Google Drive/Dropbox/OneDrive that usages fileprovider framework to sync the data ? In my endpoint secutiry app, I have registered for these events but i didnt receive any event *i do receive other endpoint secutiry events like ES_EVENT_TYPE_NOTIFY_CLONE etc.
Posted
by gsagrawal.
Last updated
.
Post not yet marked as solved
0 Replies
28 Views
Hello, I am encountering an error in my File Provider UI extension where, after calling NSFileProviderManager's getUserVisibleURL(for itemIdentifier: ) method, I receive an error: "The file “...” couldn’t be opened because you don’t have permission to view it." Looking at the system logs I see the following output: 2024-04-18 12:49:42.847462+0800 0x26c76 Error 0xbec93 6750 0 fileproviderd: (FileProviderDaemon) [com.apple.FileProvider:default] [ERROR] <private> is missing enumerate entitlement to lookup <private> 2024-04-18 12:49:42.847576+0800 0x26c76 Default 0xbec93 6750 0 fileproviderd: (FileProviderDaemon) [com.apple.FileProvider:default] [WARNING] No provider found with identifier <private> for calling bundle (null) on second attempt. 2024-04-18 12:49:42.847688+0800 0x26c76 Error 0xbec93 6750 0 fileproviderd: (FileProviderDaemon) [com.apple.FileProvider:default] [ERROR] Provider ID com.app.name.FileProviderExt is not allowed to provide item ID <private> to consumer ID (null) This issue only appears on my development machine with the release app bundle codesigned with the intended certificate for release. This is a machine where I have built this same application using a personal development certificate (which works fine and does not face this error). On a second Mac, which has never had this app installed, I do not face this error.
Posted Last updated
.
Post not yet marked as solved
1 Replies
64 Views
I am using NetFS's NetFSMountURLAsync api to mount SMB share in mac os app. I am able to mount the share however this share is not automatically appearing in Finder's sidebar. I tried using LSSharedFileListInsertItemURL to make the mount point available in Finder's side bar however facing crash on line, kLSSharedFileListItemBeforeFirst.takeRetainedValue() from below code snippet. let itemType: CFString = kLSSharedFileListFavoriteItems.takeRetainedValue() if let list: LSSharedFileList = LSSharedFileListCreate(nil, itemType, nil)?.takeRetainedValue() { let inPropertiesToSet: CFMutableDictionary = CFDictionaryCreateMutable(nil, 1, nil, nil) CFDictionaryAddValue(inPropertiesToSet, unsafeBitCast(kLSSharedFileListVolumesNetworkVisible, to: UnsafeRawPointer.self), unsafeBitCast(kCFBooleanTrue, to: UnsafeRawPointer.self)) let driveUrl = URL(fileURLWithPath: mountPoint) let shareUrl: CFURL = driveUrl as CFURL if let item: LSSharedFileListItem = LSSharedFileListInsertItemURL( list, kLSSharedFileListItemBeforeFirst.takeRetainedValue(), nil, iconRef, shareUrl, inPropertiesToSet, nil) { let itemRefId = LSSharedFileListItemGetID(item) let itemRefIdStr = "\(itemRefId)" userDefaults.set(itemRefIdStr, forKey: mountPoint) } } Anything wrong in above code? Also since this api is deprecated is there any alternative API to achieve this. The goal is to make the mount point available in Finder's sidebar so that user can easily access it.
Posted
by apjoshi.
Last updated
.
Post not yet marked as solved
0 Replies
84 Views
I think I've got all the keys and entitlements set up ok. I have no problem receiving normal alerts via the UNUserNotifications framework. Now I'm trying to use PushKit (for fileProvider). I have the following in my AppDelegate fileProvider = PKPushRegistry(queue: nil) fileProvider.delegate = self fileProvider.desiredPushTypes = [.fileProvider] along with the required delegate functions. I am never provided with credentials, only an immediate call to the didInvalidatePushToken delegate. Any suggestions appreciated.
Posted Last updated
.
Post not yet marked as solved
0 Replies
176 Views
I have verified NSExtensionPrincipalClass, appGroup. We are using authentication with File Provider UI but when I tried to debug the extension, AppDelegate is getting called instead if initialising the File Provider extension class with iOS 17.4 but it's working well with 17.2
Posted Last updated
.
Post not yet marked as solved
4 Replies
378 Views
Hi all, with yesterday's macOS 14.4 update, fileproviderctl removed the listproviders option. I couldn't find a replacement. Other options like dump domain result in error: Import Cookie: Der Vorgang konnte nicht abgeschlossen werden. (GSLibraryErrorDomain-Fehler 2 - Invalid volume URL) Is there anything I can do about this except for wait for Apple to fix this? Or was removing listproviders even done intentionally? Thanks! Sebastian
Posted Last updated
.
Post not yet marked as solved
9 Replies
508 Views
NSFileProvider Extension based on Xamarin.Mac constantly crashes starting on MacOS 14.4 Beta Steps to Reproduce: Create simple Xamarin.Mac solution and add FileProviderExtension project Storage appears in Locations section in Finder Expected Behavior: Cloud storage shows folders content Actual Behavior: Cloud storage doesn't show folder content, just infinite running spinner FileProviderExtension process constantly crashes. It occurs only in OSX starting from 14.4 beta. Please review crash report and help me understand whats wrong and how to fix it. Simple project written with Swift and Xcode works without any issues. May be it’s related to issue described here https://forums.macrumors.com/threads/fileproviderctl-on-sonoma-14-4-here-we-f-ng-go-again.2418353. Thanks in advance! Environment-Info.log CrashReport.txt
Posted Last updated
.
Post not yet marked as solved
0 Replies
150 Views
Hello. I have the following question. I have a program that creates files with its own extension and reads them. When I select a file with my extension in the Files app, it automatically opens my app. But if a file with my extension is attached to an email, when I click on my file it shows me a screen with programs to open (actually it shows my program the second time I click on the file, if I click the first time, my program is not listed) . I have a question, is it possible to make the file with my extension attached to the letter immediately open in my program without additional screens or is it not allowed. If possible, then what did I miss, based on the fact that it opens immediately from the Files program. Thank you. P.S. File how it works below: ![] [Image Edited by Moderator to Remove Personal Information]
Posted
by 20a.
Last updated
.
Post not yet marked as solved
0 Replies
119 Views
We're trying to implement a file locking mechanism to prevent multiple users from editing the same file at the same time causing conflicts. Our previous implementation worked well on Ventura, but on Sonoma, even when just previewing a file in Finder in Column View, as opposed to editing, it locks. This is the same behaviour we experienced with Apple's FruitBasket sample code. There is a isFileViewerRequest flag inside the NSFileProviderRequest object provided with the NSFileProviderReplicatedExtension enumerator function. We thought this would indicate a file being edited. After further investigation, we were told that the isFileViewerRequest flag just indicates if a file is being presented, not just edited. We find the intended behaviour a bit strange, why would anyone want an icon next to a file to indicate presented? Why is the behaviour working fine on Ventura as a locking mechanism but on Sonoma it can only be considered a presented mechanism? If the intended behaviour is to indicate a file being presented, why did it change behaviour going from Ventura to Sonoma? A feature that was useful in Ventura becomes useless in Sonoma and the fix is for us to adjust to a new meaning of it. My main question is the following: Is there a recommended mechanism to determine if a file is being edited so that we can implement locking to avoid simultaneous editing? Thanks
Posted
by __jorge.
Last updated
.
Post not yet marked as solved
0 Replies
162 Views
I'm trying to make a macOS app using SwiftUI that supports dragging arbitrary files from the app into finder. However, I'm getting this error: "Sandbox extension data required immediately for flavor public.file-url, but failed to obtain." I'm looking through the entitlements and not finding anything obvious here. I've tried various forms of NSItemProvider(): Try 1: let itemProvider = NSItemProvider(item: image.data as NSSecureCoding, typeIdentifier: image.uniformType.identifier) // Tried presenting as data itemProvider.registerDataRepresentation(for: .fileURL, visibility: .all) { completion in ... } // Tried presenting as file itemProvider.registerFileRepresentation(for: .fileURL, visibility: .all) { completion in ... } Try 2: let itemProvider1 = NSItemProvider(contentsOf: tempFileUrl, contentType: .fileURL) Tried using this form as well. In the completion handler for register*Representation(), i'm typically creating a temporary file and returning that.. (either the URL to the file or the data directly, depending on the API): let tempFileUrl = URL.temporaryDirectory.appending(path: "testfile.png") _ = tempFileUrl.startAccessingSecurityScopedResource() defer { tempFileUrl.stopAccessingSecurityScopedResource() } completion(tempFileUrl as data, nil) // option 1 completion(data, nil) // option 2 Disabling App Sandbox in the entitlements file does not work, but the error message goes away. So it seems like I have two problems: some sort of entitlement error and I must be using NSItemProvider() incorrectly. Anyone have any suggestions? I don't see to many examples out there for supporting exporting files (e.g. images) from an app into Finder. Thanks!
Posted
by dannys42.
Last updated
.
Post not yet marked as solved
0 Replies
96 Views
This sample program : @main struct DocumentPickerApp: App { var body: some Scene { DocumentGroup(newDocument: DocumentPickerDocument()) { file in ContentView(document: file.$document) } } } This sample program is running correctly on iOS, iPadOS. But this program is not running correctly on macOS. Xcode version 15.3, compile correctly all OSs, but on macOS cannot change Picker's file. I cannot understand the reason. Please tell me, the way of this problem!!
Posted Last updated
.
Post not yet marked as solved
2 Replies
376 Views
I was successfully able to get the callback for file reads for the files in my mounted folder. Now we need to implement some read protection on top of that, we need to only allow some specific applications to access the data through the File provider. for that, we need to get the name or any information regarding the Application that requested the read. one thing I've seen is the request.requestingExecutable , which is coming nil for all the applications trying to read the files in the mounted folder. But i do get applications name for the things done by finder (drag&drop and Copy paste) . What are the ways I can get the reading Application names ? and what could be done for implementing data leak features working in pair with the File Provider Extension ?
Posted Last updated
.
Post not yet marked as solved
2 Replies
423 Views
Our application which isn't a sandboxed app tries to access(copies) the file from the URL given by the file provider to the application's cache path but fails with the 'operation not permitted' error. This happens in two cases 1. File Creation & 2. File Modification. Also, on checking the path, it is like "/Library/Application Support/FileProvider/{RandID}/wharf/wharf/propagate". Even we tried to access the folder using a Python script and run it via the terminal but it also failed with the same error. But when we enable the 'full disk access' option in the 'privacy & security' tab of the system settings for the application(our main app/terminal), the files can be accessed. Our application doesn't need the 'full disk access' instead it needs permission to access the file provider extension's cache path where the temp files were stored. How to get permissions for that folder and access the files (like setting the entitlement keys or other ways)? Or else Is there any way to inform the system to use our application cache path as the file provider's cache path? Any help would be appreciated.
Posted
by Kalidoss.
Last updated
.
Post marked as solved
1 Replies
211 Views
So, I'm looking into startaccessingsecurityscopedresource() function and from my current understanding this is to get temporary access to files/folders you don't implicitly have access to i.e., that don't belong to your sandbox. I can understand what it means wrt macOS, iOS, iPadOS, but what does it mean in watchOS and tvOS where there isn't any file sharing between different apps? And what is it's relevance wrt using iCloud (if there is any?)
Posted
by Ash228.
Last updated
.
Post not yet marked as solved
1 Replies
1.1k Views
Hello, I'm having issues running a precompiled binary through Terminal. The binary is a custom fork of software used to send code to a microprocessor through USB. The distributor is a known company and they have the binaries working on their machine (but I don't know which version of macOS they use). I was running Ventura 13.2.1 on a 2021 M1 and upgraded to Sonoma 14.3.1 — neither worked. I'm using zsh. I symlink the location of the binary, and it returns File Exists however, when I try to run the command, I receive zsh: permission denied: command then, when I sudo the command, I receive sudo: command: command not found. If this binary is not signed by Apple, could this be the reason it's not working? Could it be because I have FileVault turned on? Are others having this issue in their applications? Thank you
Posted Last updated
.
Post marked as solved
1 Replies
313 Views
For example I created a project aaa. aaa source folder is called aaa. that is aaa aaa/aaa then I put a data file in aaa/aaa/some.data now i want to test data in aaa/aaaTests/aaaTests.swift How can i access aaa/aaa/some.data in aaaTests.swift? If I want to access some.data inside aaa/aaa/ContentView.swift, how to write the code? I have been searching google and bing for days, but find no example answering my questions. Can anyone help me out? Thanks in advance.
Posted
by calidion.
Last updated
.
Post not yet marked as solved
1 Replies
374 Views
I've defined a FileDocument with an init(configuration: ReadConfiguration) .... I've got a URL via .fileImporter - now I'd like to actually read and process (the JSON content). How do I get the ReadConfiguration from the URL? (And what would I search for to avoid this probably trivial issue?) Of course, I wrote the JSON file in the first place... so I could just read the contents as Data and decode it to JSON. But then what is the point of FileDocument other than to provide .fileExporter with a required argument?
Posted
by GoZoner.
Last updated
.
Post not yet marked as solved
0 Replies
234 Views
I am trying to sync some metadata fields via NSFileProviderItem extendedAttributes and have been successful when using arbitrary tag names prefixed by "#S" This is good but pretty much useless as those fields won't be indexed by Spotlight and won't be displayed in Finder In order to have my fields displayed in Finder I am attempting to return the com.apple.metadata fields but they seem to be all systematically ignored with or without sync suffix. This is really a big limitation and surprising given the fact that the tagData call works beautifully to synchronised keywords that are then populated in the extended attributes and indexed by Spotlight. One more drop in the bucket of unanswered / undocumented questions in this forum ... Thanks for any help.
Posted Last updated
.
Post not yet marked as solved
0 Replies
249 Views
Hello, I had a strange bug in a File Provider app and I found out that the problem was that NSFileProviderEnumerator's invalidate() was called during an operation (a download or even a file enumeration operation from the server). The files are stored on a server and while fetchContent is called and the extension waits for the server to send the file (or enumerate a long list of files), invalidate() is called. And after some time the extension is re-initialised. I know that the extension can be deallocated by the OS from time to time, but why during an operation? If a do a cleanup inside invalidate() I will lose references to my downloads or operations. Any thoughts on this? Is there any way to prevent this? Thank you.
Posted Last updated
.