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

83 Posts
Sort by:
Post marked as solved
1 Replies
493 Views
I'm trying to put a sub menu inside the context menu using the NSExtensionFileProviderActions in info.plist. Which should look like this image below I have been trying to use FPUIActionExtensionViewController for doing this task but I havent got any context menu like above. But still doing that does seem to complicate the task more. Is there a simpler way to do this task, like doing it within the info.plist so I dont have to complicate the task by creating a view controller. ?
Posted
by
Post not yet marked as solved
1 Replies
507 Views
I discovered a multithreading mistake in my use of NSManagedObjects recently and was surprised that I wasn't alerted to this during development, since I had -com.apple.CoreData.ConcurrencyDebug 1 set under "arguments passed on launch" for my macOS and iOS FileProvider extensions. I confirmed that the expected log stating CoreData: annotation: Core Data multi-threading assertions enabled. is NOT present when running these targets (but does appear as expected on my main macOS and iOS applications). Can anyone advise me on how to get this concurrency debugging functionality to work on my FileProvider extension(s)? Thanks
Posted
by
Post not yet marked as solved
1 Replies
629 Views
I'm asking this because the documentation is totally contradicting to itself on multiple occasions: Extensions overview page (https://developer.apple.com/app-extensions/) claims it's not supported. At the same time, on FileProviderUI docs page (https://developer.apple.com/documentation/fileproviderui) macOS is listed among another platforms and docs kinda generally suggest it is supported. At the same time, "add new target" dialog in xcode is missing "File Provider UI Extension" template under macOS. At the same time, it's can be easily be done by creating an iOS extension, then swapping SDK to macOS and UIKit APIs to their AppKit counterparts. This way, FileProviderUI actions DO appear in Finder. Problem is, after clicking the action, UI never appears and here's what i see in Console: default pkd Waiting on thread <private> until Launch Services database seeding is complete. default Finder [d <private>] <PKHost:0x600000c38cc0> Beginning discovery for flags: 1024, point: (null) default Finder [d <private>] <PKHost:0x600000c38cc0> Completed discovery. Final # of matches: 0 error Finder nil extension for provider ID (<private>), error: (null) error Finder Action with identifier (<private>) did finish with error (Error Domain=FPUIActionViewControllerErrorDomain Code=1000). error Finder FP Custom action sheet finished with error Error Domain=FPUIActionViewControllerErrorDomain Code=1000 "(null)" default pkd [d <private>] Final plugin count: 0 This is totally confusing, please elaborate.
Posted
by
Post not yet marked as solved
0 Replies
298 Views
Is it possible to indirectly delete data stored in the stock iOS "File" app from any external app (without opening the File app)? As reference information, we have confirmed that when data is deleted from a third-party file app (e.g. Readdle's documents(https://readdle.com/ja/documents) the data is also deleted from the genuine iOS file app.
Posted
by
Post not yet marked as solved
0 Replies
434 Views
We are implementing a file system extension using the file provider replicated extension for an application on Mac OS. On part of it, we need to show context menus for items(files/folders) inside the file provider's mounted folder. But we don't want to show the context menu based on the 'activation rule' key's value declared on each NSExtensionFileProviderActions item in the info.plist file but with the main app's code logic. Because if we use the info.plist activation rule, we need to use each item's instance variables as part of predicate query(which decides on showing the context menu item), and after performing the action, we need to change the value of that instance variable so that we can show opposite context menu of the previous one (for example if previously 'set offline' is clicked, now 'set online' have to be shown) but doing this is tedious process. Also, we already implemented the code logic in our main app(that is not written in swift) to choose what are the context menu items to be shown and so we want to use it. So, Instead, we are hoping to do it either: By handling the get-menu function call or By handling the predicate checking function call. Kindly let us know if is there any function we can override or inform the system to do at least any one of the above things. Thanks in advance.
Posted
by
Post not yet marked as solved
1 Replies
430 Views
Currently, we are doing it by: Calling the function 'signalEnumerator' with the identifier as workingset Returning the metas of the new changes to the function enumerateChanges called by the file provider Sometimes, it would take more time to get the enumerateChanges function call from the file provider after invoking the signalEnumerator function. So, Kindly let us know if is there any other alternative to pass the new updated items information to the file provider properly and quickly.
Posted
by
Post not yet marked as solved
0 Replies
393 Views
Previously, we are using the Finder Sync extension for showing the context menu on the finder items. But now we are planning to use the File Provider extension on Mac OS. So, as of our learning, we found that the context menu items to be shown on the finder items have to be informed using the 'NSExtensionFileProviderActions' key in the info.plist file and the activation rule also have to be informed there under key 'NSExtensionFileProviderActionActivationRule'. But in the Finder Sync, we can get both the right-click(to list menu) and menu item clicked(on the context menu shown) calls from the Finder Sync extension. Like Finder Sync Extension, can we able to get both the calls from the file provider extension?​
Posted
by
Post not yet marked as solved
0 Replies
364 Views
Hello, I am interested in developing an iOS app that can monitor the names of third-party applications running in parallel without collecting any user-specific data. I would like to inquire about the feasibility of implementing such functionality within the iOS ecosystem and if there are any privacy terms or restrictions that I need to be aware of to ensure compliance with Apple's policies. Additionally, I want to emphasize that the app will not collect any user-specific data but only the names of third-party apps for operational purposes. Thank you for your guidance.
Posted
by
Post not yet marked as solved
1 Replies
418 Views
Hello Everyone, I'm trying to add badges to files in my File Provider Extension for macOS. I'm not trying to create my own Item decorations here, but use the default Icons provided by apple (such as com.apple.icon-decoration.badge.heart , com.apple.icon-decoration.badge.pinned). I've gone through the Sample code provided by Apple for Fruit Basket. I've tried to replicate the same thing in my Extension as well but It seems I'm unable to display Icons. I'm not even getting any Error when the Icons are not being displayed, So I've been stuck for a month on this. These are the Things that I've done below: Folder Structure : FileExplorer |- FileProviderApp | |- UI.swift | |- ContentView.swift |- Extension |- extension.swift |- item.swift |- enumerator.swift |- info.plist According to the instructions given in the Documentation for Decorations here : https://developer.apple.com/documentation/fileprovider/nsfileprovideritemdecorating. The implementation was done as follows: content inside info.plist of the File provider Extension <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>NSExtension</key> <dict> <key>NSExtensionFileProviderSupportsEnumeration</key> <true/> <key>NSExtensionPointIdentifier</key> <string>com.apple.fileprovider-nonui</string> <key>NSExtensionPrincipalClass</key> <string>$(PRODUCT_MODULE_NAME).FileProviderExtension</string> <key>NSFileProviderDecorations</key> <array> <dict> <key>BadgeImageType</key> <string>com.apple.icon-decoration.badge.heart</string> <key>Category</key> <string>Badge</string> <key>Identifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER).heart</string> <key>Label</key> <string>Heart Item</string> </dict> </array> </dict> </dict> </plist> In my extension's NSFileProviderItem I've also Implemented the protocol NSFileProviderItemDecorating. and the decoration's method as static let decorationPrefix = Bundle.main.bundleIdentifier! static let heartDecoration = NSFileProviderItemDecorationIdentifier(rawValue: "\(decorationPrefix).heart") var decorations: [NSFileProviderItemDecorationIdentifier]? { var decos = [NSFileProviderItemDecorationIdentifier]() decos.append(Item.heartDecoration) return decos } I was expecting to see badges on the File items in Finder, but i got nothing. When I modified the FruitBasket Project to do the same i was able to see badges, but not when I try to implement it in my Extension. Was I missing a step or is the issue something else ?
Posted
by
Post not yet marked as solved
0 Replies
334 Views
We are developing File Provider for macOS. We followed apple sample app, and are able to create a File Provider with Container app and an extension. We are able to get this working while building from Xcode. But the distributable build does not load the extension and fails with error "Application can not be loaded". We need help with understanding root cause of the issue, and exact entitlement that we can use for creating distributable builds.
Posted
by
Post not yet marked as solved
4 Replies
958 Views
Crash in fileproviderctl Invoking fileproviderctl from the Terminal.app results in crash. ot@wpg-img-mbp bin % fileproviderctl --help zsh: killed fileproviderctl --help Checked the Device log for more details, and found this, default 10:35:47.810676+0530 kernel mac_vnode_check_signature: /usr/bin/fileproviderctl: code signature validation failed fatally: When validating /usr/bin/fileproviderctl: dynamic: com.apple.fileproviderctl disallowed without com.apple.private.amfi.version-restriction entitlement default 10:35:47.810733+0530 kernel proc 58397: load code signature error 4 for file "fileproviderctl" default 10:35:47.811297+0530 kernel ASP: Security policy would not allow process: 58397, /usr/bin/fileproviderctl default 10:35:47.811420+0530 kernel fileproviderctl[58397] Corpse allowed 1 of 5 default 10:35:47.828366+0530 ReportCrash Formulating fatal 309 report for corpse[58397] fileproviderctl default 10:35:47.838691+0530 osanalyticshelper creating type 309 as /Users/ot/Library/Logs/DiagnosticReports/.fileproviderctl-2023-09-14-103547.ips default 10:35:47.852670+0530 osanalyticshelper Saved type '309(<private>)' report (25 of max 25) at /Users/ot/Library/Logs/DiagnosticReports/fileproviderctl-2023-09-14-103547.ips default 10:35:47.853184+0530 ReportCrash client log create type 309 result success: /Users/ot/Library/Logs/DiagnosticReports/fileproviderctl-2023-09-14-103547.ips default 10:35:47.853323+0530 ReportCrash no MetricKit for process fileproviderctl type 309 bundleId (null) default 10:35:47.852983+0530 osanalyticshelper xpc log creation type 309 result success: /Users/ot/Library/Logs/DiagnosticReports/fileproviderctl-2023-09-14-103547.ips And also found the fileproviderctl in the Crash DiagosticsReports, looks like a codesigning issue. I'm not sure how I got into this issue, but I need this to be fixed. Any help is appreciated! Added the Crash Report and Device Information below, Crash Report of fileproviderctl Crash Report Device Information
Posted
by
Post not yet marked as solved
0 Replies
303 Views
I am developing a FileProvider extension which will be launched for one or more domains. In the case where I have two domains, say with displayNames "Foo" and "Bar", the finder will then show "MyExtension - Foo" and "MyExtension - Bar" respectively after registering them with addDomain. However, if I only have a single domain, let's say "Foo" – then I just see "MyExtension" rather than "MyExtension - Foo". Now ideally I'd like to be able to control the entire name, but barring that at least be able to show the displayName even with a single domain. How can I achieve that?
Posted
by
Post not yet marked as solved
1 Replies
342 Views
I want my app to open a folder and read (optionally edit) the files inside it. From the SwiftUI documentation it looks like DocumentGroup might be a good solution since I wouldn't need to manually handle the bookmarks / permissions. How do I use DocumentGroup for this? The following code crashes upon startup: DocumentGroup( editing: CodeRepository.self, contentType: .directory ) { Text("editor view") } To be clear this is to open an view any user selected folder. Not a folder with a custom file extension.
Posted
by
Post not yet marked as solved
2 Replies
510 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
Post not yet marked as solved
1 Replies
344 Views
For a new file creation, we need to throw NSFileProviderError(.cannotSynchronize) but we need the file provider to use our identifier instead of the file provider's default identifier (Say 'fp_{RandomID}'). So, we tried giving the NSFileProviderItem object created with our identifier in the completion handler of the createItem function and set the error field with NSFileProviderError(.cannotSynchronize). But this would create another item in the finder with a name suffixed with '2'(Say 'FileName 2') but the temporary File Provider Identifier and the filename(Say 'FileName') of this NSFileProviderItem object are the same as the previous one. Only the finder and the URL fetched using FileManager.getUserVisibleURL function shows 'FileName 2'. Why is this behaviour happening? Why can't the file provider use the identifier given by the main app? What is the proper way to throw an error in the createItem function but to use the given custom identifier for the item instead of the FP default identifier so that the FP should use the custom identifier in future references? Thanks.
Posted
by
Post not yet marked as solved
0 Replies
418 Views
The goal is to get the current directory when user is browsing and get the updates from the server and populate using enumerateChanges. There is no trigger natively from FileProvider Extension that I can make use of, if there is anything I missed please let me know. I have also tried FInderSyncExtension and pointed it to the CloudStorage path, while it worked flawlessly in the other location but not in CloudStorage location ~/Library/CloudStorage/***-YYY So, how do I get notified when user is browsing in my FileProvider Folders?
Posted
by
Post not yet marked as solved
1 Replies
429 Views
I have applied content policy as "downloadEagerlyAndKeepDownloaded" on the folder which i want to materialise (want to implement windows similar feature Always keep on this device feature in mac os in FileProvider). For root item the policy is downloadLazily and for rest of the item it is inherited. The issue i am facing is, while dematerialising the folder, the file provider'e evictItem api is continuously failing with resource busy error though there is no file from that folder in an open state. And it keeps giving the same error and unable to dematerialise that folder.
Posted
by
Post not yet marked as solved
1 Replies
339 Views
I am running a similar code in FileProvider extension, which throws an notAuthenticated error if the user is not logged in. How do I make user to launch the parent app for the authentication? func enumerateItems(for observer: NSFileProviderEnumerationObserver, startingAt page: NSFileProviderPage) { if(isSignedOut){ observer.finishEnumeratingWithError(NSFileProviderError(.notAuthenticated)) return } } And in the Finder it shows The right corner has Sign in button how do get action control of that button?
Posted
by
Post not yet marked as solved
0 Replies
286 Views
Using the File Provider API on macOS, I would like to ensure that renaming or moving an item locally wins when the same item is conflictingly deleted remotely. The default behavior seems to be that the delete wins in these two scenarios (compared to local edits, where the item is recreated in response to the conflict (createItem is called following the enumeration of the remote deletion)). Is there a way for my file provider to indicate that the system should recreate the now modified item following my handling of the deletion? The intended behavior can be observed with iCloud, by taking your Mac offline and renaming or moving an item. Before bringing the Mac back online, permanently delete the same item from another device. Many thanks.
Posted
by