Spiff
Spiff

Reputation: 903

iCloud ubiquity container url is nill

I’m creating a .pdf reader for tvOS. I’d like to store the .pdfs in an iCloud Drive folder and access them read-only. Not suprisingly, I’m encountering difficulty getting iCloud to work: FileManager.default.url(forUbiquityContainerIdentifier: nil) always returns nil.

I’m assuming that I need to added the entry to info.plist (why doesn’t Xcode do this?) I’m including the following. The key matches my bundle ID with a prefix of ‘iCloud’.

<dict>
    <key>iCloud.com.spiffcleanser.books</key>
        <dict>
            <key>NSUbiquitousContainerIsDocumentScopePublic</key>
            <true/>
            <key>NSUbiquitousContainerName</key>
            <string>books</string>
            <key>NSUbiquitousContainerSupportedFolderLevels</key>
            <string>Any</string>
        </dict>
</dict>

I have a number of questions but all are related so I hope its acceptable to ask them all at once. At this point I’m merely trying to get the container URL.

  1. I’m using the default ubiquity container. I’ve created an iCloud entitlement and have checked CloudKit. Do I need to specify a container from the list or is the default container used implicitly if I don’t specify one?
  2. My identifier on the developer sigh indicates that I have an iCloud entitilement. The container assignment matches what I specify in Xcode. If I’m using the default container, should the list be empty or should I configure a container with the bundle ID of my app in the same manner as in the .plist file?
  3. I know that after modifying the entitlements I need to rebuild the provisioning profile, is it sufficient to toggle ‘Automatically manage signing’ or do I need to explicitly create a profile?
  4. Is it necessary to bump the version number each time I change the config? I assume incrementing the build number is sufficient.

Thanks for any help.

Upvotes: 0

Views: 470

Answers (1)

Spiff
Spiff

Reputation: 903

I've solved this. iCloud support for documents is not available on tvOS. This is due to only minimal local storage being available.

Upvotes: 1

Related Questions