Search code examples
ioscore-dataios5icloudentitlements

iCloud entitlements rejected


I've worked for a while now on my (existing) app to add support iCloud synchronization. In total, I have 3 Versions of the app:

a) regular iPhone version
b) lite (free) iPhone version
c) iPad version

I want to use iCloud to make the core data storage sync between all 3 versions/devices. I've got the implementation, and the development versions I put on my devices worked great.

Yesterday I decided to submit the iPhone versions, but they got rejected:

Invalid Code Signing Entitlements - The signature for your app bundle contains entitlement values that are not supported. For the com.apple.developer.ubiquity-container-identifiers entitlement, the first value in the array must consist of the prefix provided by Apple in the provisioning profile followed by a bundle identifier suffix. The bundle identifier must match the bundle identifier for one of your apps or another app that you are permitted to use as the iCloud container identifier.

Specifically, value "[teamid].com.[myself].[somename]" for key "com.apple.developer.ubiquity-container-identifiers" in [my app] is not supported.

I really have no clue about how those identifiers should look like. On this page: https://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/iCloud/iCloud.html#//apple_ref/doc/uid/TP40007072-CH5-SW1 they say something about containers of my other apps ... do I have to add 3 containers for the 3 versions of my app? So far I configured under project/targets/summary/entitlements:

[x] iCloud Key-Value Store: com.[myself].[somename]
iCloud Containers: com.[myself].[somename]

for all 3 versions (same identifiers). What do I have to configure exactly, so that all 3 versions will sync their core data storage database through iCloud?


Solution

  • According to iCloud Design Guide: iCloud Fundamentals, all your apps sharing your iCloud container, can do so using a single iCloud container (if that is what you wish). The catch here is that the primary (first) container ID must be the Bundle ID of your current app being developed, or a Bundle ID of any of your previously submitted apps (that share the same Team ID).

    I'll bring an example,

    Let us assume that your app regular iPhone app (a) has a Bundle ID com.yourteam.iphoneapp and it was the one that you submitted first and is available on the App Store. Then you have to provide that same ID as the primary iCloud container ID for all other versions as well.

    Here's a relevant section out of the document mentioned above:

    In the Xcode target editor’s Summary tab, you can request access to as many ubiquity containers as you need for your app. 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.

    1. Pick one of your iCloud-enabled apps to serve as the primary app for the common ubiquity container. The app you pick can be the current one you are developing, or another app of yours submitted for distribution in the App Store and whose entitlements use the same team ID.