Post not yet marked as solved
I have had 2 apps in the store for several years now. Unfortunately, I have never been able to advertise.
They were supposed to be 2 separate apps. The English and the Spanish version. They were incorrectly loaded as one - English and Italian languages - not Spanish.
In addition, I have no access to my files. My questions are: can I replace these apps with a newly created version with same Titles?
My new version is huge - what is the maximum file size for interactive eBook or IOS Apps?
Post not yet marked as solved
hello why in the world Apple made iOS 14 and downloaded it yesterday onto my phone and it’s been overheating the back of my phone and this is insane how do I fix this Apple issue, because for a fact I know this is the company’s update and fault that this is going on , help me fix my issue any suggestions / I have an iPhone 11 /
Post not yet marked as solved
I work on a cloud sharing solution and I am trying to make some directories read only.
I have used "fileSystemFlags" and "capabilities" properties in the NSFileProviderItemProtocol to enforce read only behaviour but it only works when the user is drag and dropping in finder.
How can I really make a folder readonly using the file provider extension?
I tried to create file/folder from Finder or Terminal it gives permission denied(as expected).
However, sudo mkdir created a folder from terminal either way :(. I noticed this is the same behaviour in iCloud Drive unfortunately.
Since these are folders/files shared by someone else even with sudo rights user should not be allowed to create or modify files.
Can read onlyness be achieved with extended attributes or some other ways?
Thank you
Post not yet marked as solved
I found this under Capabilities in the App ID configuration. The help text says it can be used on both iOS and macOS.
What is it good for?
How can I take advantage of it?
Post not yet marked as solved
I am trying to implement a file provider for macOS. I’ve been using the Fruit Basket demo project provided by Apple to help me figure out how this can be done. I have met with some success, in that I can get directories of files to show up.
I now want to be able to support being able to delete files. I can do this from the command line, however when trying to access the context menu for an item in my file system through the Finder, there is no option to delete or move the item to the trash. In the Fruit Basket demo project, any domains created there have the option to move their items to the trash through the Finder. So far, I have been unable to figure out why this works for Fruit Basket and not for my application.
How can someone allow their file provider to support moving items to the trash?
Note: The Fruit Basket project is designed to be built and run on macOS 12 (Monterey). I’m creating my file provider for macOS 11 (Big Sur).
(1) Hi All, I'm a bit of a newbie to Apple, but have used FreeBSD/Linux so I'm somewhat familiar with it's file systems and access with C, C++, and TclTk. I'm really trying to wrap my head around the "Apple FileManager" but find the documentation difficult without the best of examples. Are there any good books out on Xcode, Apple Foundation usage (FileManager) and the NSFileSystem?, etc? Or how to even read and understand Apple's Developer Documents?
Thanks to Quinn (The Eskimo), for replying on Swift Forum, he suggested I follow up here, and he gave me some good pointers on Docs to read. I believe now the below question is due to attributes of "Sandboxing". Since I knew MacOS was BSD underneath, I'd used a Terminal and created other directories other than just the "recommended". While playing with Xcode, I noticed if I used MacOS, "Command Line" and complile a File enumerator from "let directoryURL = URL(fileURLWithPath: "/Users/me/Documents/MyFolder")" I get it asking do I want to give it permission to view my "MyFolder". If I set up a "MacOS, App, and use the same code it fails and I see no asking permission box come up. **Is there a way to give specific access/Entitlements to folders under /Users/me/folders to the/an Xcode app I'm working on? ** The below "NDUOASV" demo code from Apple is what has led me down this path....
If I drop the folders from Finder into the NDUOASV app, it works.
(2) Does anyone out there have experience with "NavigatingHierarchicalDataUsingOutlineAndSplitViews" in the Apple docs. If so please read the following.
I've been playing with it to try and help understand the Apple File System and usage. I've put in a print("debug", url) in the function func addFileSystemObject(_ url: URL, indexPath: IndexPath) {
In the code, I've located where they load a default example directory for viewing in their app in their file "OutlineViewController.swift". The code is
let appsURLs = FileManager.default.urls(for: .applicationDirectory, in: .localDomainMask) addFileSystemObject(appsURLs[0], indexPath: IndexPath(indexes: [0, 0]))
It does as expected. The file URL is " debug file:///Applications/".
However when I change the directory such as
let docsURLs = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask) addFileSystemObject(docsURLs[0], indexPath: IndexPath(indexes: [0, 0]))
I would of expected it locating my Documents Directory (which is iClouded) under my user directory.
Instead it creates a directory... "debug print file:///Users/me/Library/Containers/com.example.apple-samplecode.SourceViewMD7FZBNW84/Data/Documents/"
I believe the demo app is sandboxing me correct?
But when I drag and drop a folder from my user documents directory into the app from finder it's "debug result is...
" debug file:///Users/me/Documents/MyFolder/ "
Post not yet marked as solved
Whenever I click on update, my macbook starts to download files and then it displays this dialog:
What is causing this and what do I need to do in order to install updates?
Post not yet marked as solved
I am trying to build an App with File Provider finder extension (*.appex) with Xcode 12.5 (12E262) on macOS Big Sur 11.3.
The app and its plugin work well when I execute them with "Product -> Run" in Xcode. The sync folder create by File Provider locates at the Finder sidebar and users are able to manipulate files.
However, if I take the App built by Xcode and execute at somewhere else, the extension in App may not be started by fileproviderd as before.
Observations
I create two folders in my home folder, which are ~/fileprovider-1 and ~/.fileprovider-2.
The only different is that the second folder name starts with dot . and would not be seen in Finder (invisible).
Put my App in ~/fileprovider-1
Everything works, File Provider extension is launched and files are enumerated in that sync location.
Put my App in ~/.fileprovider-2
Nothing happened, only Main App is started. File Provider extension doesn't do anything.
After checking the log I found some deny error which doesn't print in the case 1:
Main App: /Users/allen/.fileprovider-2/Drive.app
Extension App: /Users/allen/.fileprovider-2/Drive.app/Contents/PlugIns/DriveProvider.appex
2021-09-15 17:14:44.882366+0800 0x34ce3 Default 0x2b638 440 0 pkd: [com.apple.PlugInKit:ls] [u 5574EECF-XXXX-XXXX-XXXX-XXXXXXXXXXXXXXXX] [com.test.allen.Drive.DriveProvider(1.0)] plugin INSTALLED; bundleID: [com.test.allen.Drive.DriveProvider], path: [/Users/allen/.fileprovider-2/Drive.app/Contents/PlugIns/DriveProvider.appex], contained in [com.test.allen.Drive]
2021-09-15 17:14:44.909224+0800 0x344ca Error 0x2a9fe 541 0 fileproviderd: (FileProviderDaemon) [com.apple.FileProvider:default] [ERROR] Failed to create descriptor for extension <EXConcreteExtension: 0x7f8c98f2c620> {id = com.test.allen.Drive.DriveProvider}
2021-09-15 17:14:44.909173+0800 0x344ca Error 0x0 0 0 kernel: (Sandbox) Sandbox: fileproviderd(541) deny(1) file-read-data /Users/allen/.fileprovider-2/Drive.app/Contents/PlugIns/DriveProvider.appex
2021-09-15 17:14:44.910654+0800 0x344ca Default 0x2a9fe 541 0 fileproviderd: (FileProviderDaemon) [com.apple.FileProvider:default] [WARNING] no root reachable for provider <FPDProvider:0x7f8c9a063bc0 "com.test.allen.Drive.DriveProvider" uuid:"(null)">, skipping
Problem
I have no idea why folder name starts with . may make this difference.
Changing the entitlements in Main App / Extension App may not help, because the denied process is fileproviderd and it's not controlled by us.
Is there any method to avoid this problem? Any suggestions or comments are welcomed.
Best,
Allen
Post not yet marked as solved
What's the purpose of NSFileProviderReplicatedExtension.item(for:request:completionHandler:) call. It seems like it duplicate what the NSFileProviderEnumerator.enumerateItems(for:startingAt:) already returned. I couldn't find where and why this method is called. What happens if it return different types than from the enumerator? Can you please point me to some explanation what is the relation between these two calls?
Post not yet marked as solved
I have implemented a file provider extension that seems to be working.
I need to be able to block users from renaming files or folders to illegal names such as a name containing a '/' for example.
In renameItemWithIdentifier
I can scan the name and return an error but all the user sees is an ugly generic error message displaying an error domain and an error code.
Is there any way to display my own error message?
Post not yet marked as solved
In my file provider the URL path I get when the a file is modified and the files app calls itemChangedAtURL starts with "/var/..." but in all other cases the URLs start with "/private/var/...".
As a result when I call [self persistentIdentifierForItemAtURL: url] I get nil back because it doesn't recognize the path.
I know that /var is actually a link to /private/var but am I expected to resolve this internally?
Here is some of my code:
- (nullable NSFileProviderItemIdentifier)persistentIdentifierForItemAtURL:(NSURL *)url {
//NSLog(@"FileProviderExtension persistentIdentifierForItemAtURL");
// resolve the given URL to a persistent identifier
if (!url || ![url isFileURL])
return nil;
NSString *prefixPath = [_myRoot stringByAppendingPathComponent:@"/"];
NSString* urlPath = [url path];
NSLog(@"FileProviderExtension persistentIdentifierForItemAtURL prefixPath:%@ urlPath:%@", prefixPath, urlPath);
if (!prefixPath || !urlPath || (urlPath.length <= prefixPath.length)) {
NSLog(@"FileProviderExtension bad-URL persistentIdentifierForItemAtURL prefixPath:%@ urlPath:%@", prefixPath, urlPath);
return nil;
}
NSRange prefixRange = [urlPath rangeOfString:prefixPath];
if ((prefixRange.location == NSNotFound) || (prefixRange.length == 0)){
NSLog(@"FileProviderExtension bad-URL persistentIdentifierForItemAtURL prefixPath:%@ urlPath:%@ prefixRange :%lu", prefixPath, urlPath, prefixRange.length);
return nil;
}
return [urlPath substringWithRange:NSMakeRange(prefixRange.length, urlPath.length - prefixRange.length)];;
}
- (void)itemChangedAtURL:(NSURL *)url {
NSLog(@"FileProviderExtension myPlaceholder itemChangedAtURL: %@", url);
NSFileProviderItemIdentifier itemIdentifier = [self persistentIdentifierForItemAtURL: url];
if (itemIdentifier)
[self notifyPathChanged:[self parentIdentifierForItemIdentifier: itemIdentifier]];
}
Post not yet marked as solved
I have a working fileprovider extension but if I go to the photo album, for example, and share a photo and choose 'Save to Files' my files provider location appears in the list but is grey and inactive so it cannot be chosen.
What do I need to do so that it is enabled?
Post not yet marked as solved
We anticipate utilizing many API's. Maps Static, Places, Geo-coding, Geo-location, Heat Utility, overlays, universal-cross platform map, etc.
2. We are developing a Dating Application, similar to Bumble, Tinder, and Hinge. However, our app will have a main feature that allows usage of a map.
The documentation to NSFileProviderManager.signalEnumerator(for:) says
Alerts the system to changes in the specified folder’s content.
and headers says:
Set the containerItemIdentifier to the identifier of the enumerated container that was specified in
-[NSFileProviderExtension enumeratorForContainerItemIdentifier:error:]
from that, I understand the parameter is any container identifier that returns valid NSFileProviderEnumerator.
I think I tried everything already, and it just doesn't seem to work this way. The only container that seems to work is .workingSet
I'm not sure whether it suppose to work with anything else than workingSet container, or I'm missing some important part that makes it happen. Does anyone have a sample that works with eg. rootContainer?
help. I'm loosing on this one.
Post not yet marked as solved
Hi all,
I'm working on a FileProvider extension and I'm getting kind of lost. My questions:
The working set of the app is local, offline and shouldn't contact the cloud. Do I build a working set on-device, or should I -after login- collect all working set data and cache it on device and signal a change to the working set?
My assumption is that I don't save folder nodes to disk when enumerated from the cloud, but only the actual files, is that correct?
Thanks in advance and have a wonderful day!
Post not yet marked as solved
Hi,
I am trying to use UIDocumentPickerViewController to select a folder in a 3rd party file provider as a "default save location". The goal would be to have that folder be the automatic location to save to whenever the app needs to write a file out to disk, instead of the app's Documents directory.
When I present the UIDocumentPickerViewController for selecting folders, however, every 3rd party file provider is grayed out. Only "On this Device" and "iCloud Drive" are available.
let controller = UIDocumentPickerViewController(documentTypes: [kUTTypeFolder as String], in: .open)
controller.delegate = self
controller.allowsMultipleSelection = false
present(controller, animated: true, completion: nil)
The documentation states:
"With iOS 13, users can select a directory from any of the available file providers using a UIDocumentPickerViewController."
It seems strange that this is specifically called out in the docs, but it doesn't work at all. One hypothesis that I have is that there is some confusion in the system between kUTTypeFolder and kUTTypeDirectory which is causing this issue. But it's weird that this would be an issue from iOS 13 through iOS 15.
As a workaround, I also tried moving/copying a temporary directory with UIDocumentPickerViewController to the 3rd party provider, and using the resulting security-scoped URL to create new files. However, it seems that it doesn't grant proper permissions because whenever I try to create files in that folder, it throws an error claiming the file doesn't exist (duh, that's what I'm trying to do.)
let temporary = try! TemporaryFile(creatingTempDirectoryForFilename: "placeholder")
FileManager.default.createFile(atPath: temporary.fileURL.path, contents: nil, attributes: nil)
let controller = UIDocumentPickerViewController(documentTypes: [kUTTypeFolder as String], in: .open)
controller.delegate = self
controller.allowsMultipleSelection = false
present(controller, animated: true, completion: nil)
func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
let folderURL = urls.first!
let randomNumber = String(format: "%X", arc4random())
guard folderURL.startAccessingSecurityScopedResource() else {
Swift.debugPrint("Cannot access security-scoped URL: \(folderURL)")
return
}
defer { folderURL.stopAccessingSecurityScopedResource() }
let fileURL = folderURL.appendingPathComponent(randomNumber).appendingPathExtension("txt")
var error: NSError?
NSFileCoordinator().coordinate(writingItemAt: fileURL, options: .forReplacing, error: &error) { fileURL in
let data = Data(randomNumber.utf8)
do {
try data.write(to: fileURL, options: [])
} catch {
print("error writing file:")
print(error)
}
}
}
error writing file:
Error Domain=NSCocoaErrorDomain Code=4 "The file “3A7F4A2.txt” doesn’t exist." UserInfo={NSFilePath=/private/var/mobile/Containers/Shared/AppGroup/D9D4024B-AD43-4B57-920B-D8E2B5ED7645/File Provider Storage/non-file/d_LOCAL-0A6C7195-23D8-43AE-9CBC-B84F063E2B44/3A7F4A2.txt, NSUnderlyingError=0x2817ea100 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
Does anyone have an idea for a workaround for this issue? Are there any known 3rd party file providers which are known to work? Is there any reason this would be disallowed? Finally, does anyone have an idea how I could implement the intended functionality in a way that I haven't thought of, yet?
Post not yet marked as solved
Hi everyone,
As per my understanding, NSFileProviderTypeAndCreator is available only on macOS. But when going through the apple documentation, I could see two structs with the same name as above and shows its availability in both iOS and macOS.
Also, when I use the NSFileProviderTypeAndCreator struct in iOS, XCode throws an error saying the struct is not available.
Please help me in understanding the availability of NSFileProviderTypeAndCreator.
Post not yet marked as solved
how to access file with FTP protocol to a server .
i want to read directory in ftp and after load picture to apps
Post not yet marked as solved
I'm using UIDocumentPickerViewController to import document to my app from OneDrive and I want to show the OneDrive folder every time I use UIDocumentPickerViewController instead of the last folder I opened. Is it possible? Can I use pickerController.directoryURL ? And how to get folder URL of OneDrive?
class ViewController: UIViewController, DocumentDelegate {
var picker: DocumentPicker?
override func viewDidLoad() {
super.viewDidLoad()
picker = DocumentPicker(presentationController: self, delegate: self)
}
@IBAction func create_picker(_ sender: Any) {
picker?.presentDocumentPicker()
}
func didPickImage(image: UIImage?) {}
}
protocol DocumentDelegate: AnyObject {
func didPickImage(image: UIImage?)
}
class DocumentPicker: NSObject {
private var pickerController: UIDocumentPickerViewController?
private weak var presentationController: UIViewController?
private weak var delegate: DocumentDelegate?
init(presentationController: UIViewController,
delegate: DocumentDelegate) {
super.init()
self.presentationController = presentationController
self.delegate = delegate
}
func presentDocumentPicker() {
pickerController = UIDocumentPickerViewController(forOpeningContentTypes: [.image])
if let pickerController = pickerController {
pickerController.delegate = self
pickerController.allowsMultipleSelection = false
presentationController?.present(pickerController, animated: true)
}
}
}
extension DocumentPicker: UIDocumentPickerDelegate {
func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
guard let url = urls.first else { return }
print(url)
}
}
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 ?