Search code examples
swifticloudcloudkit

cloudkit custom container name


I've downloaded apple's CloudKitAtlas sample code to learn about cloudkit.

To run it I have to change the container name. But I wasn't able to do it so far. I cannot use the default's container. And when I click "specify custom containers" and add one, I always get two errors messages:

Add the "iCloud" entitlement to your app ID

Add the "iCloud containers" entitlement to your app ID

I have tried many different names, like for instance: iCloud.com.myawesomeatlas.CloudKitAtlas

I also tried to "fix issues", unselect iCloud, restart Xcode but nothing changed.

If anyone has any idea...


Solution

  • The default container name is based on the app bundle identifier. You can set that in your app settings under General, Identity. For your app you do need iCloud capabilities. You could set that in you app settings, capabilities, iCloud. There you can select the default container or specify a custom container. That custom container must already exist.