Is there a way to implement the behaviour - participants reverse their acceptances of CKShares? After the participants accept the CKShares, they go over the shared and say oh no I don't want to contribute anything to the shared and I don't even want to keep the shared records in watch lists of their UI interface.
How do we do to remove them from such collaborations (from shared database to be exact)? The use case is very legitimate as people may accept somethings so that having a chance to go over a bit before decide wether they actually contribute their time and efforts into the shared.
I have tried to use CKModifyRecordZonesOperation
to delete the shared zone of CloudKit shared database:
var zoneOp = CKModifyRecordZonesOperation(recordZonesToSave: nil, recordZoneIDsToDelete: [zoneID]
zoneOp.database = sharedDB
However, it seems any shared zones can't be deleted from any participants' iOS devices (except for using their development CloudKit Dashboards that may work though) as such attempt is followed by CKError - disallow delete zone...
From the docs: https://developer.apple.com/documentation/cloudkit/ckshare
Deleting the share is simple:
The question is how to get the original
CKShare.recordID
?Zone-wide-share
Re-create the share id of the zone by using the
zoneID
:Other shares
For other shares I think you'll have to store the ID when accepting the share:
You might also be able to fetch the accepted shares, but I haven't tried this code: