bmueller
bmueller

Reputation: 2711

Sharing iCloud documents between apps

I have two apps that are currently in the App Store that use iCloud. They're using different entitlement identifiers, but now I'd like to be able to access documents from the first app in the second app.

Is it possible to add the first app's ubiquity container identifier to the second app in order to access the first app's documents, without damaging the ubiquity container that's already in place for the second app?

Obviously I should've had them share identifiers in the first place, but did not think of that when the apps were first submitted.

Upvotes: 4

Views: 1696

Answers (1)

Caleb
Caleb

Reputation: 125007

From the docs, it looks like it is indeed possible to do what you want. See the section Configuring a Common Ubiquity Container for Multiple Apps in iCloud Design Guide, which says in part:

For example, say you provide a free and paid version of your app. You’d want users, who upgrade, to retain access to their iCloud documents. Or, perhaps you provide two apps that interoperate and need access to each other’s files. In both of these examples, you obtain the needed access by specifying a common ubiquity container and then requesting access to it from each app.

The section goes on to explain how to configure one of the apps' containers as the common one:

In the first row of the Xcode target editor’s iCloud Containers list, enter the bundle identifier of your primary iCloud-enabled app.

Upvotes: 0

Related Questions