File Provider

RSS for tag

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

Posts under File Provider tag

200 Posts

Post

Replies

Boosts

Views

Activity

problem with .FileImporter in fisical divice
Hello, I was testing with forms in applications in xcode, I created a button to import a file and a simple label where the name of the file was displayed. This tested in a simulator works perfectly, but when I send it to TestFlight and download it to my iPad, it opens the documentPicker but when I choose a file it does not load anything. No errors shown, no permissions issues. What could it be?
6
0
1.3k
Nov ’23
Download a file in a File Provider Extension in iOS
I am developing a cloud-based application and have integrated the FileProviderExtension. However, files larger than 20 MB are not downloading as it’s throwing a memory limit exception. In this process, I have downloaded the file data, but after downloading the data, I need to decrypt the data. I am getting a memory limit exception during decryption. I am using the below lines to decrypt the data. let symmetricKey = SymmetricKey(data: key) let sealedBox = try AES.GCM.SealedBox(combined: inputData) let decryptedData = try AES.GCM.open(sealedBox, using: symmetricKey) I am getting memory limit exception at AES.GCM.open(sealedBox, using: symmetricKey)
3
0
1.1k
Nov ’23
Download a file in a File Provider Extension in iOS
I am developing a cloud-based application and have integrated the FileProviderExtension. However, files larger than 20 MB are not downloading as it’s throwing a memory limit exception. In this process I have downloaded the file data but after downloaded data need to decompression the data . I am getting memory limit exception during decompression. I am using below file to decompress the data. let decompressedData = try? decryptedChunkBytes?.gunzipped() Data+Gzip.swift
1
1
1k
Nov ’23
FileProvider Extension not working when code signed
My project has a base app which is manually signed, inside I have a FileProvider parent app and extension. When things works elegantly in Xcode debug build when I run FP App. But, when I package it, the FileProvider can't mount, fails with a generic error on parent app (Error Domain=NSFileProviderErrorDomain Code=-2001 "The application cannot be used right now." UserInfo={NSLocalizedDescription=The application cannot be used right now.} Another generic error in FileProvider demon fileproviderd(488) deny(1) file-read-data /Applications/XYZ.app/Contents/Resources/FileFP.app How to solve this?
2
0
2.0k
Nov ’23
How to change displayName for a Replicated File Provider extension domain on macOS?
I'm working on a Replicated File Provider extension for macOS. I've come across an issue recently on macOS 13+. It seems that the displayName of the domain changes when I call addDomain multiple times with the same NSFileProviderDomainIdentifier but with different displayName parameters. This behavior seems correct so far. However, the displayName, and of course the actual path under CloudStorage, revert back to their original values when I call disconnect to a domain manager. Here's the code snippet of getting existing doamin and disconnecting it: NSFileProviderManager.getDomainsWithCompletionHandler() { domainList, error in defer { dispatchGroup.leave() } for domain in domainList { if domain.identifier == NSFileProviderDomainIdentifier(rawValue: String(sessionId)){ domainResult = domain break } } } dispatchGroup.wait() guard let manager = NSFileProviderManager(for: domainResult) else { return -1 } manager.disconnect(reason: disconnectReason, options: []) { error in defer { dispatchGroup.leave() } errorResult = error } dispatchGroup.wait() Could a member of the internal team please help confirm if this is the correct method for updating the displayName of an existing domain? Additionally, is there a way to ensure that the new displayName persists even after disconnecting it? It would be great to allow users to customize and set a meaningful name for it. Thanks. Min
0
0
487
Nov ’23
Get all local music from iPhone Same Like UIDocumentPicker Without UserInteraction
Hello, I want to fetch all local music files from an iPhone device. I tried MPMediaQuery but I can get only that file which is in the document folder.If we use UIDocumentpicker we can fetch all files from the iPhone (downloads, File Application)after selection by the user. I want to fetch all music files like UIDocumentpicker but without user interaction. Thanks in Advance for your guidance.
0
0
794
Nov ’23
Files shared for "open-in-place" editing not working correctly in iOS 17
Hello, We have an iOS app which stores PDF files locally and allows them to be opened in place for editing by third-party apps (e.g. PDF Viewer / Xodo). We have found that the technique we were using to do this is not working as expected in iOS 17, where it does in all previous iOS versions. As per the File Provider documentation,: we are storing files locally, so presume we do not need to have a File Provider extension we set to true/YES both UIFileSharingEnabled and LSSupportsOpeningDocumentsInPlace we generate an NSUrl and, via UIDocumentInteractionController presentOpenInMenu, allow the user to open the PDF in an external app On iOS 16 and lower, it works as expected; the third-party app is able to read and automatically save changes to the PDF directly in our app's folder path. For example, the Xodo logs indicate that it's opening directly from our app's path (788C7161-32EB-4AF0-964D-2A473257A791 is our application's ID): Xodo initialized document instance: <PTCoordinatedDocument: 0x282453a00> fileURL: file:///private/var/mobile/Containers/Data/Application/788C7161-32EB-4AF0-964D-2A473257A791/Documents/7cafe7e7-9da9-40cd-b233-a85b0174fe00/624cbc1e-a7c5-4c0d-8937-b0a00013b2a9.pdf Xodo opening document: <PTCoordinatedDocument: 0x282453a00> fileURL: file:///private/var/mobile/Containers/Data/Application/788C7161-32EB-4AF0-964D-2A473257A791/Documents/7cafe7e7-9da9-40cd-b233-a85b0174fe00/624cbc1e-a7c5-4c0d-8937-b0a00013b2a9.pdf On iOS 17, this no longer works correctly, and although the third-party PDF editor can read our PDF, it's quite clear that it's actually using a copy. If not quite identical to what happens when LSSupportsOpeningDocumentsInPlace is false/NO, the end result is very similar (6830EDC5-F776-4BEF-8C30-046BCA1F2DF0 is Xodo's application ID): Xodo initialized document instance: <PTCoordinatedDocument: 0x2828aae00> fileURL: file:///var/mobile/Containers/Data/Application/6830EDC5-F776-4BEF-8C30-046BCA1F2DF0/Documents/Processed%20Files/624cbc1e-a7c5-4c0d-8937-b0a00013b2a9.pdf Xodo opening document: <PTCoordinatedDocument: 0x2828aae00> fileURL: file:///var/mobile/Containers/Data/Application/6830EDC5-F776-4BEF-8C30-046BCA1F2DF0/Documents/Processed%20Files/624cbc1e-a7c5-4c0d-8937-b0a00013b2a9.pdf The third-party app will immediately prompt the user to save the file, but regardless, the copy is now beyond the purview of our app so we can no longer see any changes made to it. The only workaround is to have the user explicitly share the file from the third-party app back to our app (we have the code in place to handle this), but much preferred the seamless "open-in-place" integration which did not require this. There have been vague allusions to changes in the file system in iOS 17, but we have not been able to find primary sources or much specific detail. For example: https://developer.apple.com/forums/thread/733642 https://developer.apple.com/forums/thread/737971 Are there specific changes in iOS 17 that invalidate our strategy? Are there any other things we may be missing that are needed to make this work? Note, for further reference, this issue is described in Xamarin terms here.. Although, yes, we are Xamarin developers so do not have native code to show, we (and, based on the comments, the Xamarin devs) suspect that this is most likely due to a change in iOS rather than in Xamarin.
5
2
1.7k
Nov ’23
Issue with importing files from File browser to the app via SwiftUI
I'm getting the following error message on on iOS 17.1 and Xcode 15.0.1 The view service did terminate with error: Error Domain=_UIViewServiceErrorDomain Code=1 "(null)" UserInfo={Terminated=disconnect method} In my info.plist I have given access to all file related permissions to rule out any issues Supports opening documents in place -> YES #if os(iOS) .fileImporter(isPresented: $isiOSFilePickerShown, allowedContentTypes: [.item], allowsMultipleSelection: false, onCompletion: { result in do{ guard let selectedURL: URL = try result.get().first else { return } guard selectedURL.startAccessingSecurityScopedResource() else { return } //Some operation with selectedURL } catch let e{ print("error reading file \(e)") } }) #endif
0
0
828
Nov ’23
Changing Default Folder Name in Files App for iOS App
Hello, I'm working on an iOS app called "scribe-frontend-ios," and I'd like to change the default folder name that the app creates in the Files app on iOS. Currently, when the app saves files to the Files app, they all go into a folder named "scribe-frontend-ios." However, I want to just call this folder Scribe. I've tried modifying the Info.plist file in my Xcode project by adding the "NSFileProviderServiceName" key with a custom folder name, but it doesn't seem to have any effect. I've also set "LSSupportsOpeningDocumentsInPlace" to true to indicate that my app supports opening documents in place. Can someone please provide guidance on how to change the default folder name for the app in the Files app? Is there a step I might be missing, or is there another way to achieve this? Any help or advice would be greatly appreciated. Thank you!
0
1
740
Oct ’23
FIFinderSync and NSFileProviderReplicatedExtension together
Can these FIFinderSync and NSFileProviderReplicatedExtension work together? My app contains FIFinderSync Extension for files and folders to show Overlay icons. Recently I implemented FileProviderExtension to get the power of cloudsync. As both of them are bundled at the same location Contents/PlugIns/. Only the FileProviderExtensions work. Both have the same NSExtensionPointIdentifers, one uses com.apple.findersync while another one com.apple.fileprovider-nonui. Is this a limitation or what do I need to do so that both work together? Edit: I just noticed, FinderExt and FileProviderExt keeps switching/swapping in between. So both work in parts. But not together.
2
0
920
Oct ’23
Multiple items created when single createItem call fails
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.
1
0
602
Oct ’23
FileProvider's eviction is failing with resource busy error though no file is open
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.
1
0
878
Oct ’23
How to handle FileProvider notAuthenticated error in macOS?
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?
1
0
689
Oct ’23
FileProvider conflicts: how to have a rename or move operation win when an item is deleted remotely?
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.
0
0
587
Oct ’23
How to get user browsing directory from FileProvider Extension macOS?
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/XXX-YYY So, how do I get notified when user is browsing in my FileProvider Folders?
1
2
799
Oct ’23
fileproviderctl crashing every time
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
4
1
2.1k
Oct ’23
What is the expected way to use DocumentGroup to open and display directory content?
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.
1
0
705
Oct ’23
problem with .FileImporter in fisical divice
Hello, I was testing with forms in applications in xcode, I created a button to import a file and a simple label where the name of the file was displayed. This tested in a simulator works perfectly, but when I send it to TestFlight and download it to my iPad, it opens the documentPicker but when I choose a file it does not load anything. No errors shown, no permissions issues. What could it be?
Replies
6
Boosts
0
Views
1.3k
Activity
Nov ’23
Download a file in a File Provider Extension in iOS
I am developing a cloud-based application and have integrated the FileProviderExtension. However, files larger than 20 MB are not downloading as it’s throwing a memory limit exception. In this process, I have downloaded the file data, but after downloading the data, I need to decrypt the data. I am getting a memory limit exception during decryption. I am using the below lines to decrypt the data. let symmetricKey = SymmetricKey(data: key) let sealedBox = try AES.GCM.SealedBox(combined: inputData) let decryptedData = try AES.GCM.open(sealedBox, using: symmetricKey) I am getting memory limit exception at AES.GCM.open(sealedBox, using: symmetricKey)
Replies
3
Boosts
0
Views
1.1k
Activity
Nov ’23
Download a file in a File Provider Extension in iOS
I am developing a cloud-based application and have integrated the FileProviderExtension. However, files larger than 20 MB are not downloading as it’s throwing a memory limit exception. In this process I have downloaded the file data but after downloaded data need to decompression the data . I am getting memory limit exception during decompression. I am using below file to decompress the data. let decompressedData = try? decryptedChunkBytes?.gunzipped() Data+Gzip.swift
Replies
1
Boosts
1
Views
1k
Activity
Nov ’23
FileProvider Extension not working when code signed
My project has a base app which is manually signed, inside I have a FileProvider parent app and extension. When things works elegantly in Xcode debug build when I run FP App. But, when I package it, the FileProvider can't mount, fails with a generic error on parent app (Error Domain=NSFileProviderErrorDomain Code=-2001 "The application cannot be used right now." UserInfo={NSLocalizedDescription=The application cannot be used right now.} Another generic error in FileProvider demon fileproviderd(488) deny(1) file-read-data /Applications/XYZ.app/Contents/Resources/FileFP.app How to solve this?
Replies
2
Boosts
0
Views
2.0k
Activity
Nov ’23
How to change displayName for a Replicated File Provider extension domain on macOS?
I'm working on a Replicated File Provider extension for macOS. I've come across an issue recently on macOS 13+. It seems that the displayName of the domain changes when I call addDomain multiple times with the same NSFileProviderDomainIdentifier but with different displayName parameters. This behavior seems correct so far. However, the displayName, and of course the actual path under CloudStorage, revert back to their original values when I call disconnect to a domain manager. Here's the code snippet of getting existing doamin and disconnecting it: NSFileProviderManager.getDomainsWithCompletionHandler() { domainList, error in defer { dispatchGroup.leave() } for domain in domainList { if domain.identifier == NSFileProviderDomainIdentifier(rawValue: String(sessionId)){ domainResult = domain break } } } dispatchGroup.wait() guard let manager = NSFileProviderManager(for: domainResult) else { return -1 } manager.disconnect(reason: disconnectReason, options: []) { error in defer { dispatchGroup.leave() } errorResult = error } dispatchGroup.wait() Could a member of the internal team please help confirm if this is the correct method for updating the displayName of an existing domain? Additionally, is there a way to ensure that the new displayName persists even after disconnecting it? It would be great to allow users to customize and set a meaningful name for it. Thanks. Min
Replies
0
Boosts
0
Views
487
Activity
Nov ’23
Get all local music from iPhone Same Like UIDocumentPicker Without UserInteraction
Hello, I want to fetch all local music files from an iPhone device. I tried MPMediaQuery but I can get only that file which is in the document folder.If we use UIDocumentpicker we can fetch all files from the iPhone (downloads, File Application)after selection by the user. I want to fetch all music files like UIDocumentpicker but without user interaction. Thanks in Advance for your guidance.
Replies
0
Boosts
0
Views
794
Activity
Nov ’23
Can't open files because of "nsfileprovidererrordomain error -2005.\" What do I do?!
My computer crashed recently, and afterwards a lot of my files wouldn't open and it said it was because of "nsfileprovidererrordomain error -2005." I tried looking up what to do but nothing online really made sense and it was not offering me a solution to the problem. What should I do?
Replies
2
Boosts
2
Views
21k
Activity
Nov ’23
Files shared for "open-in-place" editing not working correctly in iOS 17
Hello, We have an iOS app which stores PDF files locally and allows them to be opened in place for editing by third-party apps (e.g. PDF Viewer / Xodo). We have found that the technique we were using to do this is not working as expected in iOS 17, where it does in all previous iOS versions. As per the File Provider documentation,: we are storing files locally, so presume we do not need to have a File Provider extension we set to true/YES both UIFileSharingEnabled and LSSupportsOpeningDocumentsInPlace we generate an NSUrl and, via UIDocumentInteractionController presentOpenInMenu, allow the user to open the PDF in an external app On iOS 16 and lower, it works as expected; the third-party app is able to read and automatically save changes to the PDF directly in our app's folder path. For example, the Xodo logs indicate that it's opening directly from our app's path (788C7161-32EB-4AF0-964D-2A473257A791 is our application's ID): Xodo initialized document instance: <PTCoordinatedDocument: 0x282453a00> fileURL: file:///private/var/mobile/Containers/Data/Application/788C7161-32EB-4AF0-964D-2A473257A791/Documents/7cafe7e7-9da9-40cd-b233-a85b0174fe00/624cbc1e-a7c5-4c0d-8937-b0a00013b2a9.pdf Xodo opening document: <PTCoordinatedDocument: 0x282453a00> fileURL: file:///private/var/mobile/Containers/Data/Application/788C7161-32EB-4AF0-964D-2A473257A791/Documents/7cafe7e7-9da9-40cd-b233-a85b0174fe00/624cbc1e-a7c5-4c0d-8937-b0a00013b2a9.pdf On iOS 17, this no longer works correctly, and although the third-party PDF editor can read our PDF, it's quite clear that it's actually using a copy. If not quite identical to what happens when LSSupportsOpeningDocumentsInPlace is false/NO, the end result is very similar (6830EDC5-F776-4BEF-8C30-046BCA1F2DF0 is Xodo's application ID): Xodo initialized document instance: <PTCoordinatedDocument: 0x2828aae00> fileURL: file:///var/mobile/Containers/Data/Application/6830EDC5-F776-4BEF-8C30-046BCA1F2DF0/Documents/Processed%20Files/624cbc1e-a7c5-4c0d-8937-b0a00013b2a9.pdf Xodo opening document: <PTCoordinatedDocument: 0x2828aae00> fileURL: file:///var/mobile/Containers/Data/Application/6830EDC5-F776-4BEF-8C30-046BCA1F2DF0/Documents/Processed%20Files/624cbc1e-a7c5-4c0d-8937-b0a00013b2a9.pdf The third-party app will immediately prompt the user to save the file, but regardless, the copy is now beyond the purview of our app so we can no longer see any changes made to it. The only workaround is to have the user explicitly share the file from the third-party app back to our app (we have the code in place to handle this), but much preferred the seamless "open-in-place" integration which did not require this. There have been vague allusions to changes in the file system in iOS 17, but we have not been able to find primary sources or much specific detail. For example: https://developer.apple.com/forums/thread/733642 https://developer.apple.com/forums/thread/737971 Are there specific changes in iOS 17 that invalidate our strategy? Are there any other things we may be missing that are needed to make this work? Note, for further reference, this issue is described in Xamarin terms here.. Although, yes, we are Xamarin developers so do not have native code to show, we (and, based on the comments, the Xamarin devs) suspect that this is most likely due to a change in iOS rather than in Xamarin.
Replies
5
Boosts
2
Views
1.7k
Activity
Nov ’23
Issue with importing files from File browser to the app via SwiftUI
I'm getting the following error message on on iOS 17.1 and Xcode 15.0.1 The view service did terminate with error: Error Domain=_UIViewServiceErrorDomain Code=1 "(null)" UserInfo={Terminated=disconnect method} In my info.plist I have given access to all file related permissions to rule out any issues Supports opening documents in place -> YES #if os(iOS) .fileImporter(isPresented: $isiOSFilePickerShown, allowedContentTypes: [.item], allowsMultipleSelection: false, onCompletion: { result in do{ guard let selectedURL: URL = try result.get().first else { return } guard selectedURL.startAccessingSecurityScopedResource() else { return } //Some operation with selectedURL } catch let e{ print("error reading file \(e)") } }) #endif
Replies
0
Boosts
0
Views
828
Activity
Nov ’23
Upload file in File Provider Extension in iOS
I am developing a cloud-based application and have integrated the FileProviderExtension. However, files larger than 20 MB are not uploading, as it's throwing a memory limit exception. Error: Thread 28: EXC_RESOURCE (RESOURCE_TYPE_MEMORY: high watermark memory limit exceeded) (limit=20 MB)
Replies
4
Boosts
0
Views
1.4k
Activity
Oct ’23
Changing Default Folder Name in Files App for iOS App
Hello, I'm working on an iOS app called "scribe-frontend-ios," and I'd like to change the default folder name that the app creates in the Files app on iOS. Currently, when the app saves files to the Files app, they all go into a folder named "scribe-frontend-ios." However, I want to just call this folder Scribe. I've tried modifying the Info.plist file in my Xcode project by adding the "NSFileProviderServiceName" key with a custom folder name, but it doesn't seem to have any effect. I've also set "LSSupportsOpeningDocumentsInPlace" to true to indicate that my app supports opening documents in place. Can someone please provide guidance on how to change the default folder name for the app in the Files app? Is there a step I might be missing, or is there another way to achieve this? Any help or advice would be greatly appreciated. Thank you!
Replies
0
Boosts
1
Views
740
Activity
Oct ’23
FIFinderSync and NSFileProviderReplicatedExtension together
Can these FIFinderSync and NSFileProviderReplicatedExtension work together? My app contains FIFinderSync Extension for files and folders to show Overlay icons. Recently I implemented FileProviderExtension to get the power of cloudsync. As both of them are bundled at the same location Contents/PlugIns/. Only the FileProviderExtensions work. Both have the same NSExtensionPointIdentifers, one uses com.apple.findersync while another one com.apple.fileprovider-nonui. Is this a limitation or what do I need to do so that both work together? Edit: I just noticed, FinderExt and FileProviderExt keeps switching/swapping in between. So both work in parts. But not together.
Replies
2
Boosts
0
Views
920
Activity
Oct ’23
Multiple items created when single createItem call fails
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.
Replies
1
Boosts
0
Views
602
Activity
Oct ’23
FileProvider's eviction is failing with resource busy error though no file is open
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.
Replies
1
Boosts
0
Views
878
Activity
Oct ’23
How to handle FileProvider notAuthenticated error in macOS?
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?
Replies
1
Boosts
0
Views
689
Activity
Oct ’23
FileProvider conflicts: how to have a rename or move operation win when an item is deleted remotely?
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.
Replies
0
Boosts
0
Views
587
Activity
Oct ’23
How to get user browsing directory from FileProvider Extension macOS?
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/XXX-YYY So, how do I get notified when user is browsing in my FileProvider Folders?
Replies
1
Boosts
2
Views
799
Activity
Oct ’23
Dynamic main / emboss icons per NSFileProviderDomain
Hi there, Anybody knows a way to make the main Finder icon as well as folder emboss icon dynamic per NSFileProviderDomain ?
Replies
0
Boosts
0
Views
512
Activity
Oct ’23
fileproviderctl crashing every time
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
Replies
4
Boosts
1
Views
2.1k
Activity
Oct ’23
What is the expected way to use DocumentGroup to open and display directory content?
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.
Replies
1
Boosts
0
Views
705
Activity
Oct ’23