TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

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      

Hacking with Swift is sponsored by RevenueCat.

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

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.