22.1. Setting Up Your App for iCloud

Problem

You want to start using iCloud in your apps, and you would like to know how you should set up your Xcode project.

Solution

At a high level, these are the steps you need to follow to enable iCloud storage in your app:

  1. Create a new App ID that has iCloud enabled in it.

  2. Create a new development provision profile that is linked to that App ID and download and install that profile onto your computer.

  3. Create a new app in Xcode and set the provision profile for that app to the profile that you just created.

  4. In the Capabilities tab in Xcode, flick the iCloud switch on.

Your app is now set up for iCloud. In the Discussion section, we will talk more about the details of these steps and the things that could go wrong during the setting up process.

Discussion

In the Solution section, we had a brief look at the high-level steps required to set your app up for iCloud. Here we are going to look at the details with illustrations. So let’s get started.

  1. Create an app in Xcode and set its bundle identifier using a reverse-domain style: for instance, com.pixolity.ios.cookbook.icloudapp. Remember that this is the reverse domain style bundle identifier that I have chosen for my app. Usually you would take the domain name of your website and just reverse that and append the identifier of your app to the results.

  2. Using the iOS Provisioning Portal, create a new App ID for your app. Enable iCloud for that App ID by selecting it in the portal, enabling the checkbox for iCloud, ...

Get iOS 7 Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.