cloudkit sync not getting cloudkit updates

I performed the steps outlined in the using CoreData and Cloudkit wwdc session with xcode 11 beta 2:

1) Create new master detali project

2) Enabled Coredata and Cloudkit

3) Added Cloudkit capability (Which also adds Push capability)

4) Added Background modes with Remote Notifications

I've fired up two devices in he simulator and added new entires. The new entries are added to Cloudkit from the devices. I can see them in the cloudkit dashboard. However, the devices do not get updated with the entries that were added with the other devices.

Also if I delete the app on the devices and reinstall, it does not pull any of the entries that are stored from cloudkit, even the ones entered on the device. So it appears that things are getting written from Core Data to Cloudkit, but reads from Cloudkit are not working. I know that this is still in beta, but should the reads from cloudkit be working?

Replies

Apparently does not work on simulator only actual devices. See this from Andrew Bancroft https://www.andrewcbancroft.com/blog/ios-development/data-persistence/getting-started-with-nspersistentcloudkitcontainer/

It works in the simulator but syncs only on app startup when you set the automaticallyMergesChangesFromParent-option on the viewContext. See https://stackoverflow.com/questions/56601716/how-to-get-default-project-with-nspersistentcloudkitcontainer-up-and-running

The actual sync via push notification only works on real devices.

Thanks. Setting the automaticallyMergesChangesFromParent to true worked for me in the simulator. Brilliant!