Search code examples
iosswifticloud

How to sync iOS and OS X apps with iCloud?


I made an iOS application which uses iCloud that I called Notes (it's the ugly version of Apple's Note app, just for training), and it's app ID is ramy.alzuhouri.Notes.

Now if I create another Xcode project for OS X and I create an iCloud application with the same app ID, it turns out that I can't because the app ID is already taken:

enter image description here

An App ID with identifier 'ramy.alzuhouri.Notes' is not available. Please enter a different string.

I could use a different identifier, but I want the OS X app to synchronize with the iOS app, just like Apple's note: when you write a note on the iPhone you can see it on the MacBook and viceversa. How can achieve that?


Solution

  • iCloud synchronization use a container that can be shared between app, the app ID is ignored. When you enable iCloud in app Capabilities make sure that both of them use the same container. You can use the default one in one app and in the other choose to use a custom container and select the one used by the first app.