Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my iCloud Drive AppFolder visible on MacOS, but disabled in iCloud Drive App on iOS?

I developed an iCloud Drive Export feature for my iOS App and it works. I can see the exported Documents in our public AppContainerFolder in the iCloud Drive folder on Mac OS X 10.11.

But on iOS, I only can see the AppContainerFolder in the iCloud Drive app. It is disabled and I am not able to open that folder, or see the documents inside.

Image of the disable folder in the iOS iCloud Drive App

From the iCloud Drive settings, I can see that the files I have exported are in that AppContainerFolder in iCloud Drive.

Image of the AppContainerFolder inside the iCloud settings

Has anyone had such an issue with iCloud Drive?

I am using two app containers in my app, one with the "iCloud.com..." identifier for the exports and another with the "TeamIdentifier.com..." identifier for the Ensembles-CoreData syncing. I explicitly use the URLs for the Containers using the method:

[[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:@"iCloud.com..."]

I already tried to only use the TeamIdentifier-Container, but there was no change in the visibility of the AppContainerFolder.

I tried to bump the BundleVersion, I played around with the Info.plist NSUbiquitousContainers settings. I also made Builds available through TestFlight to external testers, to see if it has something to do with development devices.

The only thing, I hadn't done yet, to release a new version to the AppStore with a new BundleVersion, to see if it has something to do with a productive app vs. an app in development.

Any tips and hints welcome.

like image 341
Bernd Avatar asked Oct 14 '15 08:10

Bernd


2 Answers

After clarification with the Apple Developer Technical Support, I was now able to solve the issue.

My app declares two exported UTI's (own backup files), so that the iCloud container will default to NOT being enabled (or grayed out), when other files than these UTI's are saved into that folder. Our app is able to create PDF's and CSV's, but these file types were NOT declared as 'Document types' in the info.plist, because our app is not able to display them.

When adding the PDF and CSV document types to the info.plist, the iCloud container gets instantly visible in the iCloud Drive app.

For your reference, here is an extract of the info.plist:

...
<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeIconFiles</key>
        <array/>
        <key>CFBundleTypeName</key>
        <string>Adobe PDF</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
        <key>LSHandlerRank</key>
        <string>Alternative</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>com.adobe.pdf</string>
        </array>
    </dict>
    <dict>
        <key>CFBundleTypeIconFiles</key>
        <array/>
        <key>CFBundleTypeName</key>
        <string>CSV</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
        <key>LSHandlerRank</key>
        <string>Alternative</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>public.comma-separated-values-text</string>
        </array>
    </dict>
</array>
...
like image 82
Bernd Avatar answered Oct 23 '22 22:10

Bernd


The post Why my app is not shown in iCloud Drive Folder seems to indicate your app needs to be approved and released before a public iCloud folder works fully.

like image 44
MichaelR Avatar answered Oct 23 '22 21:10

MichaelR