Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iCloud Documents not visible

I am trying to use iCloud Documents to store XML files from my iOS App. Everything seems to be working fine (I can write and read files without errors) except my App's files do not show up in iCloud Documents neither in icloud.com nor in developer.icloud.com nor on my Windows PC in iCloud Drive folder. I was running the app in simulator and tested with TestFlight on a real device. I have the latest version of iCloud for Windows 4.0 installed. The App is created in Xcode 6.

Does anyone know how to make the files appear in iCloud Documents?

The code I am using for the saving the file:

NSLog(@"Syncing with iCloud");
    NSURL *ubiq = [filemgr URLForUbiquityContainerIdentifier:nil];
    if (ubiq) {
        NSURL *ubiquitousPackage = [ubiq URLByAppendingPathComponent:@"Documents" isDirectory:YES];
        if ([filemgr fileExistsAtPath:[ubiquitousPackage path]] == NO)
            [filemgr createDirectoryAtURL:ubiquitousPackage
              withIntermediateDirectories:YES
                               attributes:nil
                                    error:nil];

        ubiquitousPackage = [ubiquitousPackage URLByAppendingPathComponent:@"data.pxa"];

        DataFile *file = [[DataFile alloc] initWithFileURL:ubiquitousPackage];
        file.xmlContent = doc.XMLString;
        [file saveToURL:[file fileURL] forSaveOperation:UIDocumentSaveForCreating | UIDocumentSaveForOverwriting completionHandler:^(BOOL success) {

            if (success) {
                NSLog(@"Synced with iCloud: %@", [ubiquitousPackage path]);

            } else {
                NSLog(@"Syncing with iCloud failed");
            }
        }];
    } else {
        NSLog(@"iCloud not available");
    }
like image 400
Nostradamus Avatar asked Oct 10 '14 08:10

Nostradamus


People also ask

Why can't I see my documents on iCloud?

If you don't see an iCloud Drive option, go to Finder > Preferences from the menu bar. Then click Sidebar and enable the iCloud Drive option. Interact with these files and folders the same way you would any other file or folder on your Mac.

Why are my iCloud files not showing on my iPhone?

If your files don't update to iCloud Drive Sign in to iCloud on all of your devices and turn on iCloud Drive. Make sure that you have an active Internet connection on your Mac and on your iPhone, iPad, or iPod touch. Install the latest versions of Pages, Numbers, and Keynote.

Why can't I see my iCloud documents on my new Mac?

The best way to view iCloud Drive content on your Mac is by using Finder. If you can't find iCloud Drive folders after updating macOS, double-check your Finder preferences to ensure iCloud Drive is turned on. Even if iCloud Drive used to appear in Finder, updating macOS may have reset your settings to hide it.

Why are my documents not showing up on my Mac?

Step 1: On your Mac, open Finder and select the Finder option from the top menu and click on the “Preferences” option. Step 2: The Finder Preferences window will open up. In the “Sidebar” tab, select the box placed right next to the “Documents” option. With this, the disappeared Documents folder will show up instantly.


1 Answers

I found out what the problem was: The key in Info.plist for the iCloud container was a bit different from the format "iCloud.com.example.MyApp".

like image 154
Nostradamus Avatar answered Sep 18 '22 11:09

Nostradamus