Updating the metadata of iCloud containers for iCloud Drive
Q:
I am trying to expose my iCloud container on iCloud Drive by adding an NSUbiquitousContainers
entry in my Info.plist. It seems that iCloud Drive doesn’t accept any changes once the metadata specified in that entry has ever been gathered. Why is that?
A: The first time your app is installed and launched on an iOS (8.0 or later) device, the metadata specified in the NSUbiquitousContainers
entry (if existing) in your Info.plist will be extracted, associated with your iCloud containers, and used by iCloud Drive. After that, the metadata won’t be updated until a newer build of your app is detected.
For the metadata changes to be accepted by iCloud Drive, you need to bump the Bundle
version
of your app. Here are the steps:
Open your project with Xcode (6.0 or later) and make sure the
iCloud Documents
option underCapabilities
pane of your target is checked and the iCloud container is specified. (For details about how to configure your app for iCloud, see iCloud Fundamentals section of iCloud Design Guide).Log in your devices with your iCloud account and enable iCloud Drive for you app. Be sure to use the same account on your Mac (with OS X Yosemite or later) if you are using Finder to view the content of iCloud Drive.
Bump the
Bundle
version
(CFBundleVersion
) in the Info.plist of your app (or theBuild
field in theGeneral
pane of your target in Xcode Project Editor). Be sure that the new value is higher than the previous one by string comparison withNSNumericSearch
option, and only contains numeric (0-9) and period (.) characters. (SeeCFBundleVersion section of Information Property List Key Reference for more information.)Make changes on the
NSUbiquitousContainers
entry. (See Enabling Document Storage in iCloud Drive section of iCloud Design Guide for a sampleNSUbiquitousContainers
entry.)Build and run your app on your device.
After the new metadata is picked up and synchronized through iCloud, you can view the changes with Finder in OS X or the iCloud Drive app in iOS 9. (Use the UIDocumentPickerViewController
class to view the iCloud Drive content before iOS 9.)
Document Revision History
Date | Notes |
---|---|
2016-04-04 | Fixed a broken link. Mentioned the iCloud Drive app in iOS 9. |
2015-09-14 | New document that explains how to update the metadata of iCloud containers for iCloud Drive. |
Copyright © 2016 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2016-04-04