-startDownloadingUbiquitousItemAtURL:error: and NSURLUbiquitousItemDownloadRequestedKey

I'm trying to update the iCloud data handling in our app, and I'm running into an issue with a particular file on one particular device. This file never downloads & I haven't been able to pinpoint what's off about it.

Right now we just have 2 iCloud accounts & a handful of devices, so I haven't been able to narrow it down yet, but in most cases, all the cloud files download as expected.

However, whether or not the file eventually downloads, the NSURLUbiquitousItemDownloadRequestedKey key seems to be completely useless.

For the following code:

NSError *error = nil;
BOOL success = [[NSFileManager defaultManager] startDownloadingUbiquitousItemAtURL:self.fileURL error:&error];
if (!success) {
	NSLog(@"error downloading %@ : %@", self.fileURL, error);
} else {
	NSDictionary *resourceValues = [self.fileURL resourceValuesForKeys:@[NSURLUbiquitousItemDownloadRequestedKey, NSURLUbiquitousItemIsDownloadingKey, NSURLUbiquitousItemDownloadingErrorKey, NSURLUbiquitousItemDownloadingStatusKey] error:&error];
	if (!error) {
		NSString *downloadStatus = resourceValues[NSURLUbiquitousItemDownloadingStatusKey];
		bool downloadRequested = [resourceValues[NSURLUbiquitousItemDownloadRequestedKey] boolValue];
		NSLog(@"download requested: %d", downloadRequested);
	}
	// ...
}

downloadRequested is always false, regardless of whether or not the cloud file eventually downloads.

I have 2 questions:

  1. is there a way to actually check if a download has been requested for a file?
  2. what could be preventing this file from downloading? -startDownloadingUbiquitousItemAtURL:error: doesn't report an error, NSURLUbiquitousItemDownloadingErrorKey is always nil, and no error is reported in the NSMetadataQuery observer.

(not that the NSMetadataQuery actually works for monitoring the status of the download, I've never managed to get it working. I basically leave it in as bit of wishful thinking.)

-startDownloadingUbiquitousItemAtURL:error: and NSURLUbiquitousItemDownloadRequestedKey
 
 
Q