In attempting so as to add iCloud Drive entry to an present app, my app has efficiently written recordsdata operating on one iPhone after which learn these file into one other iPhone, proving that the recordsdata are certainly present in iCloud. However none of those recordsdata seem in Finder operating on my Mac Mini or within the iCloud part of the Recordsdata app on both iPhone. The recordsdata written appear to be non-public to only my app. All units and computer systems are logged in to the identical Apple ID in iCloud. The identical construct of my app was operating in each iPhones. The URL my app makes use of for iCloud consists of the “Paperwork” listing:
NSFileManager *fman = [NSFileManager defaultManager];
NSURL *urlDrive = [fman URLForUbiquityContainerIdentifier: nil];
NSURL *urlDocs = [urlDrive URLByAppendingPathComponent:@"Documents"];
NSURL *urlFile = [urlDocs URLByAppendingPathComponent: txtfname()];
the place the Ubiquitous Container is outlined within the data.plist file as:
NSUbiquitousContainers
iCloud.com.{my area}.{my app}
NSUbiquitousContainerIsDocumentScopePublic
NSUbiquitousContainerSupportedFolderLevels
Any
NSUbiquitousContainerName
{my app}
UIFileSharingEnabled
Even though my app can write from one iPhone and browse from one other iPhone, I can’t get the recordsdata, and even the listing for {my app} to seem in some other file explorer like Finder or the Recordsdata app on the telephones.
I anticipated the customers of my app to have the ability to entry the recordsdata they write from my app on a desktop laptop and do no matter they need with them, like share them with others. I didn’t use a File Coordinator as a result of the use case for my app doesn’t want it. I checked all of the return codes to verify no API was failing within the studying or the writing. One unusual factor is that when utilizing an iPhone 7 operating iOS 15.8.4 and an iPhone 13 operating iOS 18.3.2, writes from the iPhone 7 have been accessible to my app operating on the iPhone 13, however recordsdata written by the iPhone 13 weren’t accessible to the iPhone 7. Tried reads mentioned the file didn’t exist – even after ready for hours for iCloud synchronization to happen. Each telephones have been linked to the Web the entire time. I additionally bumped up the app model bundle identify at any time when I made a change to the plist file.