How to use notification to notify shared container changes in cloudkit?

I would like to create a private container and share a zone between two users with different iCloud accounts. All changes made by one would be notified with push notifications to the other user's db. Both could change the same information.

Exactly as it is done in this apple project. https://developer.apple.com/documentation/cloudkit/shared_records/sharing_cloudkit_data_with_other_icloud_users

However, I have been reading this code for days and I am stuck on it, it is extremely complicated for my level.

I would really like to know if there is any simple project that uses the same idea to build this logic with swiftui.

Answered by DTS Engineer in 805805022

In CloudKit, there are two types of sharing, zone sharing and hierarchical sharing, which are quite different. For more information on this topic, please see the following WWDC2021 session:

The sample you mentioned demonstrates hierarchical sharing. If you target to use zone sharing, see the following sample instead:

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

In CloudKit, there are two types of sharing, zone sharing and hierarchical sharing, which are quite different. For more information on this topic, please see the following WWDC2021 session:

The sample you mentioned demonstrates hierarchical sharing. If you target to use zone sharing, see the following sample instead:

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

when I am sharing a link, this message appears in the console "connection invalidated"

This happens after I click to generate a link in the sharing interface I click cloudkit share " You cannot get the URL of a share until it's been saved to the server

Copy Link failed: Couldn't retrieve shareURL for item:<_SFCKShareCollaborationItem: 0x600003747300> identifier:946489CB-BF61-48D4-BA49-3F405B38AE0B, type:1, itemProvider:<_UISharingControllerActivityItemProvider: 0x600002926c30> {types = ( UTCollaborationOptionsType, "com.apple.cloudkit.sharingsupport.container", "com.apple.cloudkit.sharingsupport.post" )}, activityItem:<_UIActivityItemsConfigurationActivityItemProvider: 0x105124a90>, placeholderActivityItem:https://www.apple.com/icloud/, options:(null), sendCopyRepresentation:(null), canAddPeople:1 (null) connection invalidated "

How to use notification to notify shared container changes in cloudkit?
 
 
Q