- PDF for offline use
Let us know how you feel about this
last updated: 2017-03
Adding capabilities to an application often requires additional provisioning setup. This guide explains the setup needed for iCloud capabilities.
iCloud provides iOS users with a convenient and simple way to store their content and share it between devices. There are four ways that developers can use iCloud to provide a means of storage for their users: Key-Value storage, UIDocument Storage, CoreData, and using CloudKit directly to provide storage for Individual files and directories. For more information on these, refer to the Introduction to iCloud guide.
Adding the iCloud capability to an application is slightly more difficult than other App Services because of containers. Containers are used in iCloud to store information for an app, and allow all information contained in a single iCloud account to be segregated – like the sandboxing on a user’s iOS device. For more information on containers, refer to the Introduction to CloudKit guide.
The steps in section Adding App Services above can be used to toggle the required iCloud capability. Depending on which means of storage is being used in your app, you may need to do additional setup. The image below shows the iCloud capabilities pane:
First select the required service. If iCloud Documents or CloudKit have been selected, you must select a container. Selecting the default container will create a new container that is unique to the app. Alternatively, if you have created a container either via Xcode or the developer portal, select it here.
When provisioning a new app through the developer center there are two steps that need to be taken:
- Create a container.
- Create an App ID with the iCloud capability and add the container to it.
- Create a Provisioning profile that includes this App ID
The steps below will guide you through these steps:
Browse to the Apple Developer Center and go to the Certificates, Identifier, and Profiles section:
Under Identifiers select iCloud Containers, and then select the + to create a new container:
Enter a Description and a unique Identifier for the iCloud container:
Press Continue, ensure that the information is correct, and press Register to create the iCloud Container:
To create a new App ID and add a container to it, do the following:
In the Developer Center, click on App IDs under Identifiers:
Select the + button to add a new App ID:
Enter a Name for the App ID and give it an Explicit App ID:
Under App Services select iCloud and choose Include CloudKit support:
Select Continue and then Register. Note that on the confirmation screen, iCloud will display with Configurable selected, with a yellow symbol:
Return to the list of App IDs and select the one that you have just created:
Scroll down to the bottom of this expanded section and click Edit:
Scroll down the list to iCloud and click the Edit button:
Select the Container to use with this App ID:
Confirm the Container assignments, and press Assign.
This App ID can now be used to generate, or to re-generate, a new provisioning profile.
For more information on using iCloud, refer to the following guides: