iCloud Drive Folder

拥有回忆 提交于 2019-11-27 17:01:00

问题


I have an OSX app that uses iCloud documents with the older Team ID ubiquity key. Does anyone know how to get the ubiquity folder to appear in the iCloud drive folder?

I have already tried using the NSUbiquitousContainerIsDocumentScopePublic key set to true in the applications pList to no effect.

Folders that appear in the iCloud drive include Apple's application, and Pixelmator.


回答1:


Add these values to your info.plist file and change your build number.

<key>NSUbiquitousContainers</key>
    <dict>
        <key>iCloud.com.example.app</key>
        <dict>
            <key>NSUbiquitousContainerIsDocumentScopePublic</key>
            <true/>
            <key>NSUbiquitousContainerName</key>
            <string>App name to display in iCloud Drive</string>
            <key>NSUbiquitousContainerSupportedFolderLevels</key>
            <string>None</string>
        </dict>
    </dict>

and add these keys to your entitlements, you will see an error on the iCloud section of capabilities, but its working fine. So DO NOT click the fix button or change it from the capabilities or it will not work anymore.

<key>com.apple.developer.ubiquity-container-identifiers</key>
        <array>
            <string>iCloud.$(CFBundleIdentifier)</string>
        </array>
        <key>com.apple.developer.icloud-services</key>
        <array>
            <string>CloudDocuments</string>
        </array>
        <key>com.apple.developer.ubiquity-kvstore-identifier</key>
        <string>$(TeamIdentifierPrefix)$(CFBundleIdentifier)</string>


来源:https://stackoverflow.com/questions/26865643/icloud-drive-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!