UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

macOS Core Data iCloud sync issue

Forums > macOS

Hi guys, A very happy new year!

I have a issue with a app update I am working on.

Currently I am busy adding iPad and macOS support to a current swiftui iOS core data with icloud app. On the iOS side the iCloud sync is working as expected on two physical devices, meaning I can add and delete items on one device and it sync to a second device, including adding and deleting from the cloudkit console and both devices sync.

Based on that the code is working.

The macOS target is looking at the same icloud database, and icloud has been added to the macOS target, but when I build and run the mac app, iCloud does not sync at all. From what I have seen online I just need to add iCloud to the new target. Clearly I am missing something here

Does anyone have a idea what else needs to be done to get that working?

Thanks in advance

Paul

2      

Hi @paulidupreez

Could you provide us with the code you have in place for iCloud please?

2      

iCloud sync working like a charm on iOS but giving the macOS app the cold shoulder?

Don't worry, we'll crack this together. Here are some quick things to check:

Entitlements: Did both versions get their iCloud access pass (a.k.a. entitlements)? Container ID: Are they using the same iCloud locker key (container ID)? Permissions: Does macOS have the keys to the iCloud kingdom in its Info.plist file? App Group: Sharing data through a secret handshake (app group)? Make sure it's configured and friendly with both apps. Error Logs: Turn on iCloud's detective mode (debug logging) to see if it leaves any clues.

2      

BUILD THE ULTIMATE PORTFOLIO APP Most Swift tutorials help you solve one specific problem, but in my Ultimate Portfolio App series I show you how to get all the best practices into a single app: architecture, testing, performance, accessibility, localization, project organization, and so much more, all while building a SwiftUI app that works on iOS, macOS and watchOS.

Get it on Hacking with Swift+

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.