Post not yet marked as solved
I have created working fileprovider, that works perfectly on my local machine. Codesigned in xcode, with our company sign certificate as Developer ID Application. No provisioning profile. Also notarized result dmg.
Works as expected on my local machine. But won't load on any other machine.
Calling [NSFileProviderManager addDomain: ...], ends up with error:
Error Domain=NSFileProviderErrorDomain Code=-2001 "The application cannot be used right now." UserInfo={NSLocalizedDescription=The application cannot be used right now.}
Code=-2001 should mean, that no file provider manager extension was found in an app bundle.
I have made a TestFileProvider application that is totally simplified File Provider example.
This too does work only on my own machine.
Relevant code from app:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
NSFileProviderDomain* fileProviderDomain = [[NSFileProviderDomain alloc] initWithIdentifier:@"com.xxxxx.dwc.FileProvider" displayName:@"TestDomain"];
[NSFileProviderManager addDomain:fileProviderDomain completionHandler:^(NSError * _Nullable error) {
if (error)
NSLog(@"add domain: %@", error);
else
NSLog(@"add domain SUCCESS");
}];
}
There are also these errors, that are related, but I do not understand what are they implying neither how to fix:
kernel Sandbox: fileproviderd(448) deny(1) file-read-data /Applications/TestFileProvider.app
fileproviderd [ERROR] PluginRecord doesn't have container url for
fileproviderd [WARNING] No provider found with identifier (null) for calling bundle (null) on second attempt.
I'm clueless on how to fix this. Is this related to codesign ? Or is it necessary to start fileprovider with different method call ?
Post not yet marked as solved
I'm working with NSFileProviderReplicatedExtension for macOS app.
I want to apply custom badge on files instead of default badges (For example, com.apple.icon-decoration.heart, com.apple.icon-decoration.pinned, .. and so on).
I tried to define new UTI in my Info.plist refering this post (-> https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/understanding_utis/understand_utis_declare/understand_utis_declare.html)
But it doesn't work.
Can i define custom badge? If yes, how can i work with this?
Please reply.
Post not yet marked as solved
Hello friends,
I saw that iOS 16 has support for NSFileProviderReplicatedExtension, and I was hoping I could use this as a backend for my SSH/SFTP client.
I have attempted to use it by adding a new "File Provider Extension" target to my application, but when I attempt to use it, the system throws an exception shortly after calling my extension constructor, reporting that my class does not respond to the beginRequestWithExtensionContext:
2022-07-11 17:38:08.775886-0400 SshFs[32841:7522410] -[SshFs.FileProviderExtension beginRequestWithExtensionContext:]: unrecognized selector sent to instance 0x600001f80220
2022-07-11 17:38:08.778225-0400 SshFs[32841:7522410] [xpc.exceptions] <NSXPCConnection: 0x600002c900a0> connection to service with pid 27736 created from an endpoint: Warning: Exception caught during invocation of selector beginRequestWithDomain:alternateContentsDictionary:domainServicer:providerDomain:domainVersion:completionHandler:, dropping incoming message and invalidating the connection.
Exception: -[SshFs.FileProviderExtension beginRequestWithExtensionContext:]: unrecognized selector sent to instance 0x600001f80220
-[SshFs.FileProviderExtension beginRequestWithExtensionContext:]: unrecognized selector sent to instance 0x600001f80220
(
0 CoreFoundation 0x000000018040d20c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x000000018005008c objc_exception_throw + 56
2 CoreFoundation 0x000000018041bd28 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
3 CoreFoundation 0x0000000180411104 ___forwarding___ + 1308
4 CoreFoundation 0x00000001804133fc _CF_forwarding_prep_0 + 92
5 FileProvider 0x000000018feb7c5c -[FPXExtensionContext beginRequestWithDomain:alternateContentsDictionary:domainServicer:providerDomain:domainVersion:completionHandler:] + 1464
6 CoreFoundation 0x00000001804135b0 __invoking___ + 144
7 CoreFoundation 0x0000000180410924 -[NSInvocation invoke] + 276
8 Foundation 0x0000000180cbc798 __NSXPCCONNECTION_IS_CALLING_OUT_TO_EXPORTED_OBJECT__ + 12
9 Foundation 0x0000000180cbb37c -[NSXPCConnection _decodeAndInvokeMessageWithEvent:reply:flags:] + 1184
10 Foundation 0x0000000180cbd5e0 message_handler_message + 84
11 Foundation 0x0000000180cbcb6c message_handler + 148
12 libxpc.dylib 0x0000000180087420 _xpc_connection_call_event_handler + 68
13 libxpc.dylib 0x00000001800877e0 _xpc_connection_mach_event + 904
14 libdispatch.dylib 0x0000000180134864 _dispatch_client_callout4 + 16
15 libdispatch.dylib 0x0000000180152f08 _dispatch_mach_msg_invoke + 624
16 libdispatch.dylib 0x000000018013c690 _dispatch_lane_serial_drain + 348
17 libdispatch.dylib 0x0000000180153fd4 _dispatch_mach_invoke + 468
18 libdispatch.dylib 0x000000018013c690 _dispatch_lane_serial_drain + 348
19 libdispatch.dylib 0x000000018013d4bc _dispatch_lane_invoke + 448
20 libdispatch.dylib 0x000000018014960c _dispatch_workloop_worker_thread + 772
21 libsystem_pthread.dylib 0x00000001add9bb40 _pthread_wqthread + 284
22 libsystem_pthread.dylib 0x00000001add9a904 start_wqthread + 8
)
I tried with a fresh project, with no baggage, and I get the same error, I uploaded it to GitHub
I am wondering what I might be missing, or if there is some sample code that I could get my hands on, just like there was some for macOS a couple of years back (FruitBasket).
Post not yet marked as solved
Hi!
I'm really confused in how works the pagination of FileProvider, Im working with the parameter startingAtpage of the method:
func enumerateItems(for observer: NSFileProviderEnumerationObserver, startingAt page: NSFileProviderPage)
And creating a new NSFileProviderPage to do the next pagination with the code:
var totalData = 51
let totalCountData = Data(bytes: &totalData,
count: MemoryLayout.size(ofValue: totalData))
observer.finishEnumerating(upTo: NSFileProviderPage(rawValue: totalCountData))
My petitions are from 50 to 50 pagination. The File Provider only show 28 elements but has received 50 items and later doesnt make the pagination. Is it possible to know how it works? I didnt find nothing about it.
Thanks in advance.
Post not yet marked as solved
Using the Fruitbasket as the reference, I've configured a Xamarin.Mac(C#) based app to use File Provider. I'm throwing NotAuthenticated error and see a sign in button on the CloudStorage. When I click on the sign in button, my FPUIActionExtensionViewController class isn't being triggered. I see the following message in the Console logs.
Action with identifier (com.apple.FileProviderUI.authenticate) did finish with error (Error
Domain=com.apple.ViewBridge Code=14 "(null)"
UserInfo={com.apple.ViewBridge.error.hint={
callStackSymbols =(
"0 CoreFoundation__exceptionPreprocess + 242",
"1 libobjc.A.dylibobjc_exception_throw + 48",
"2 Foundation-[NSAssertionHandler
handleFailureInMethod:object:file:lineNumber:description:] + 267",
"3 FileProviderUI-[FPUIActionExtensionContainerViewController
_configureWithDomainIdentifier:] + 170",
"4 FileProviderUI-[FPUIActionExtensionContainerViewController
awakeFromRemoteView] + 851",
"5 ViewBridge-[NSViewServiceMarshal
_bootstrap:replyData:completion:] + 2235",
"6 ViewBridge-[NSViewServiceMarshal bootstrap:withReply:] + 245",
"7 CoreFoundation__invoking___ + 140",
)
I get the similar error when I click on custom action
Action with identifier (com.your-company.Action.CustomAction) did finish with error (Error
Domain=com.apple.ViewBridge Code=14 "(null)"
UserInfo={com.apple.ViewBridge.error.hint={
callStackSymbols =(
"0 CoreFoundation__exceptionPreprocess + 242",
"1 libobjc.A.dylibobjc_exception_throw + 48",
"2 Foundation-[NSAssertionHandler
handleFailureInMethod:object:file:lineNumber:description:] + 267",
"3 FileProviderUI-[FPUIActionExtensionContainerViewController
_configureWithDomainIdentifier:] + 170",
"4 FileProviderUI-[FPUIActionExtensionContainerViewController
awakeFromRemoteView] + 851",
"5 ViewBridge-[NSViewServiceMarshal
_bootstrap:replyData:completion:] + 2235",
"6 ViewBridge-[NSViewServiceMarshal bootstrap:withReply:] + 245",
"7 CoreFoundation__invoking___ + 140",
"8 ).
Has anyone seen this issue before? Any suggestions or direction for troubleshooting this issue?
Post not yet marked as solved
Can NSXPCInterface work with non-void return type?
The official document says, "All messages must be 'void' return type." (Reference)
However, in the file provider sample code of wwdc21, it uses it with non-void return type.
(Reference)
I wondered whether it can or can not be used with non-void return type?
Is the answer changed after swift support for async/await?
Post not yet marked as solved
Hello! I tried several times to restore an old version of a TextEdit file, but the "revert to" option doesn't work/keeps getting stuck on the loading phase and I have to force the app to quit.
Everything is saved on my iCloud and I usually update the same files using to different computers (iMac and MacBook pro). Is there a solution or another way to recover the old version?
My MacBook pro is currently update to Monterey 12.4
Thank you!
Post not yet marked as solved
I'm working with FileProvider Framework (macOS).
It takes almost five minutes or more to remove a domain.
153: NSFileProviderManager.remove(domain) { [weak self] error in
154:
155: // Here..
Line 153 runs, and it takes more than five minutes to enter line 154.
How can i solve it?
Post not yet marked as solved
Hi All,
I have created .app on my MacBook Pro 11 big sur.
that .app has shell script wrapped.it is working on my local machine but when I zipped and uploaded to the Microsoft drive and downloaded back and unzip the file then I can see the extend attribute permissions added to that folder @ sign added . How to solve this whiteout terminal
Post not yet marked as solved
Hello, I have been working on an app for my client which provides uploading specific documents. My previous co-developer uses expo-document-picker for uploading documents and when I was testing to an IOS Simulator, it never worked. I have followed this documentation on how to manage icloud also: DocumentPicker - Expo Documentation but it seems it never worked… I have also included some specific app.json for icloud like I included usesIcloudStorage and the plugins… I dont know why it is never worked
Post not yet marked as solved
I want to localize two value in info.plist.
First one is [ NSFileProviderDecorations - Item0 - Label ],
and second one is [ NSExtensionFileProviderActionName ].
I could localize first one using InfoPlist.strings. (and Label-NSStringFormat)
But it does not work for second one.
I tried InfoPlist.strings, Localizable.strings, ..., but i can't localize this key.
What should i do?
Post not yet marked as solved
#define KdownloadsPath NSSearchPathForDirectoriesInDomains(NSDownloadsDirectory, NSUserDomainMask, YES).firstObject
_downloadedPath = [KdownloadsPath stringByAppendingPathComponent:fileName];
_downloadingPath = [_downloadedPath stringByAppendingString:@".download"];
NSDictionary* info = [NSDictionary dictionaryWithObjectsAndKeys:
@"NSProgressFileOperationKindDownloading", @"NSProgressFileOperationKindKey",
[NSURL fileURLWithPath:_downloadingPath], @"NSProgressFileURLKey",
nil];
self.progress = [[NSProgress alloc] initWithParent:nil userInfo:info];
[self.progress setKind:@"NSProgressKindFile"];
[self.progress setPausable:NO];
[self.progress setCancellable:YES];
[self.progress setTotalUnitCount:_totalBytes];
[self.progress publish];
(updating the progress indicator happens elsewhere)
I'm creating an NSProgress object to show a progress indicator underneat a file in my Downloads directory. The entitlements includes com.apple.security.files.downloads.read-write.
The indicator does not show when NSProgressFileURLKey points to the sandboxed file path, e.g. /Users/mdbraber/Library/Containers/com.mdbraber.TestApp/Data/Downloads/Test.pptx.download. It does work when NSProgressFileURLKey points to the direct download location which the sandbox links to e.g. /Users/mdbraber/Downloads/Test.pptx.download
Is this a bug or should I use something else for NSProgressFileURLKey to make this work?
Post not yet marked as solved
I've configured an item and placeholder in NSFileProviderExtension iOS extension, and an XPC service in the provider (based on the template for XPC service for Mac, but as part of the NSFileProviderExtension
When connecting to the service from the app using code example in getFileProviderServicesForItem I am getting an error straight in the completion handler of that function:
Error Domain=NSCocoaErrorDomain Code=4097 "Error while sending identifierForItemAtURL:completionHandler:" UserInfo={NSDebugDescription=Error while sending identifierForItemAtURL:completionHandler:, NSUnderlyingError=0x2833640c0 {Error Domain=NSCocoaErrorDomain Code=4097 "connection from pid 30324 on anonymousListener or serviceListener" UserInfo={NSDebugDescription=connection from pid 30324 on anonymousListener or serviceListener}}}
Could you maybe suggest what I am missing? Or, is there an example somewhere of the FileProvider extension with the service being called from the app?
Code:
File Provider service definition: https://github.com/simplex-chat/simplex-chat/blob/af3dcc4a9a9b24751bf9d74af67cf8e7d119597a/apps/ios/SimpleX%20Service/SimpleXFPService.swift
Application code that calls the service: https://github.com/simplex-chat/simplex-chat/blob/af3dcc4a9a9b24751bf9d74af67cf8e7d119597a/apps/ios/Shared/FPService.swift
Thank you!
Post not yet marked as solved
I have a cloud storage app. Right now, saving files into it creates my app's folder in On my iPhone. Is it possible to have my app's folder outside of it, in Files app's Locations list? Just like I have other cloud providers like Dropbox, OneDrive etc(see image).
Post not yet marked as solved
We are working on an app that manage receiving material and we need to take picture of the material and save it to the network (share drive).
We try all kind of tools Ex. AMSMB2 and we are not able to.
I am sure I am not the only one trying to do that. :)
Thank you for the help
Christian
Post not yet marked as solved
I'm seeing a notification come in through PushKit for my FileProvider extension on iOS:
func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) {
print("FileProvider::pushDelegate::didReceiveIncomingPush", type.rawValue, payload.dictionaryPayload)
}
For example, I'm seeing:
FileProvider::pushDelegate::didReceiveIncomingPush PKPushTypeFileProvider [AnyHashable("aps"): {
"" = "{\"container-identifier\":\"NSFileProviderRootContainerItemIdentifier\"}";
}]
But I'm not getting a ping to enumerateChanges in the enumerator that is currently active. What would cause this?
Post not yet marked as solved
Hello,
I’m trying to connect my shared iPad to a file server (SMB)
In the Files App from Apple, I can normally connect to my file server.
But when the iPad is in Shared iPad Mode, it keeps searching and it writes Connecting…
From Shortcuts I made, I found that I was getting an error message saying No file provider found with id com.apple.smbclient.fileprovider
Looks like Shared iPad are missing this system setting com.apple.smbclient.fileprovider
Post not yet marked as solved
I'm working on a FileProvider which allows access to encrypted files in Dropbox; I can successfully read and present the decrypted files, so I know it's basically working. But I'm having problems getting FileProvider to re-enumerate a folder when its encryption status changes.
When the FileProvider receives an update notification saying a folder is now encrypted, I use signalEnumerator to re-enumerate the folder:
FileProviderExtension.manager?.signalEnumerator(for: existingItem.itemIdentifier, completionHandler: { (ourError : Error?) -> Void in
if let ourError = ourError {
log("notifyCallback: mount / unmount failed re-enumeration: \(ourError)")
} else {
log("notifyCallback: mount / unmount signalled re-enumeration; pending")
}
})
The log reports that the re-enumeration is pending... but as far as I can tell, neither enumerateItems nor enumerateChanges is called on the folder's item unless a Finder window is actually open for that folder. This means that, when an app other than Finder tries to access the files through the filesystem, it doesn't see the updated set of filenames.
(For further reference: I've added code to both enumerateItems and enumerateChanges, so that if the call has been triggered by a recent folder-encryption notification, it retrieves a complete set of items from the Dropbox folder. If a retrieved file has an encrypted filename, it reports it as a modified item and returns its filename in-clear; if the filename isn't encrypted, it doesn't return the item (for enumerateItems) or returns it as a deleted item (for enumerateChanges). This approach seems to work successfully for listing folders with a constant state; it's only if the user encrypts / decrypts a folder without currently having a Finder window open inside that folder that I'm not seeing a refresh.)
Any advice on how I can force a re-enumeration without a Finder window currently being displayed?
Post not yet marked as solved
At least one other user has been asking for the FileProvider validation tool on this forum. I'd like to know when this will be placed back, because it currently looks like Apple doesn't care about companies trying to integrate with Files.app.
The documentation is lacking, unclear or dubious, sometimes even outdated. Please give us the FileProvider Validation Tool back.
In my OS X app I'm trying to fetch application's support directory. But I'm getting wrong results.
using:
FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask)
returns
///Users/chandresh/Library/Application%20Support/
instead
/Users/chandresh/Library/Containers/com.thinkbizz.ThinkBizz-Business-Dynamics/Data/Library/Application%20Support/
Although, it returns correct result while using SandBox.
It doesn't give me correct path without SandBox