9 Replies
      Latest reply on Nov 19, 2018 6:20 PM by JoePasadena
      Giordano Level 1 Level 1 (0 points)

        Hi everybody,

         

        I have an iOS app that uses iCloud documents and iCloud drive. Does anyone know how to get the ubiquity folder to appear in the iCloud drive folder?

         

        Thanks and regards,

        Giordano

        • Re: iCloud Drive Folder
          Schindler Level 1 Level 1 (0 points)

          Good question. I just had to do this myself recently.

           

          To see your app's folder in your iCloud Drive, you have to modify the Info.plist: Create an `NSUbiquitousContainers` dictionary. Within it, create a dictionary with the name of your ubiquity container. For example, `iCloud.com.yourcompany.yourapp`. Within it, create three keys: `NSUbiquitousContainerName`, a String, `NSUbiquitousContainerIsDocumentScopePublic`, a Boolean, and `NSUbiquitousContainerSupportedFolderLevels`, a String. The first of these three is the name of the folder. The second determines whether you will see your app's folder in iCloud Drive in, e.g., Finder on Mac. You'll want this value to be `YES`. The last determines whether the app's folder can have sub-folders. A value of `None` is accepted, meaning 'no,' but I don't recall the other accepted values.

           

          N.B.: The changes to these keys will only take effect if your app's version increments; and incrementing the Build No. of your target is sufficient.

           

          Also: The documentation suggests that only *used* containers appear 'publicly' in iCloud Drive, so a new empty container might not show up. I found this to be the case. When I saved a file to the `Documents` subdirectory of the ubiquitous container, only then did the app's directory appear in iCloud Drive.

           

          R

            • Re: iCloud Drive Folder
              rschluet Level 1 Level 1 (0 points)

              I have been working on this, too.  I have added the keys, upped the version number, located the ubiquity container, and wrote a test file there.  I can loop through the files in the ubiquity container in my app (OSX) and the test file is there.  However, I cannot see it in the iCloud Drive in the finder.

              • Re: iCloud Drive Folder
                rschluet Level 1 Level 1 (0 points)

                Additional information:  On my Mac, I go to system settings, iCloud, iCloud Drive options.  It lists apps that store docs there and my test app, iCloudTest, shows up there.  (I wonder what the checkmarks do there)

                However still, I don't see that folder in the finder for iCloud Drive.

                  • Re: iCloud Drive Folder
                    Schindler Level 1 Level 1 (0 points)

                    I read somewhere that in order to see the app's iCloud Drive in Finder, the app's ubiquity container must have a `Documents` subdirectory. And perhaps a non-empty `Documents` subdirectory, initially.

                     

                    R

                      • Re: iCloud Drive Folder
                        cameronchu Level 1 Level 1 (0 points)

                        My iphone app can write a file under "AppName" folder in iCloud Drive, but not able to write to "Documents" folder in iCloud.

                        If I use Finder in my MacBook to look at files in my iCloud Drive, only "Documents' folder can be seen, not "AppName" folder.

                        However, in my iphone, both "Document" and "AppName" folder can be seen.

                         

                        Why I can't see "AppName" folder created by my iphone app using MacBook?

                        Is there any way to write file directly to Documents folder in iCloud Drive?

                    • Re: iCloud Drive Folder
                      jpcoates Level 1 Level 1 (0 points)

                      Here is where it is explained.

                      https://developer.apple.com/library/content/qa/qa1893/_index.html

                       

                      The funny thing is, at least what I am experiencing, is that the folder and a file in it appear when I use the new iOS 11 Files app when I search for my app and I can see them, however that does not work when I search or look for them using the iCloud app on my Mac or online.  What am I missing? Updating the Bundle version did allow it to write the file at least. But it is still not visible using the iCloud app on my Mac or online.

                      • Re: iCloud Drive Folder
                        hlx Level 1 Level 1 (0 points)

                        I had the same experience with only "used" containers appear 'publicly' in iCloud Drive. Only way I was able to make my container folder showed up in iCloud Drive was to create a temporary file on launch of my app. Question now is how do I make the container "used" for a new user without having to create a file.

                      • Re: iCloud Drive Folder
                        JoePasadena Level 1 Level 1 (0 points)

                        Have you solved this issue? How?