Search code examples
iosswiftcore-datacloudkit

CloudKit+Core Data suddenly stopped syncing in production


I submitted an iOS app to the App Store that implements CloudKit+CoreData precisely as described here: https://www.andrewcbancroft.com/blog/ios-development/data-persistence/getting-started-with-nspersistentcloudkitcontainer/

On my devices, my app is downloaded directly from Xcode, and the sync continues to work flawlessly.

However, on a user's devices, where the app is downloaded from the App Store, the sync worked fine for a few days, then suddenly stopped. Now it is as if both my user's devices switched to local storage only. Changes made on one are never seen on the other anymore. All devices were signed into iCloud from the beginning and Settings weren't changed. All information under Signing and Capabilities is the same in Debug and Release.

Could this be a bug on Apple's part? Is there something I'm missing from the implementation of the persistent container, or something else I need to change within Xcode?


Solution

  • Check if you have made any changes to your data schema (and to your data model in this case). If so, you need to deploy these changes to production on CloudKit dashboard.

    CloudKit dashboard showing where to update production schema