I am trying to create a CKShare to the private database but with a public permission, meaning the user only needs to have the url and doesn't need to be specifically invited. The code I use to create the share is as follows but I always end up with a private share.
private func createShare(_ school: School) async
{
do
{
let (_, share, _) = try await CoreDataStack.shared.persistentContainer.share([school], to: nil)
share[CKShare.SystemFieldKey.title] = school.name
share.publicPermission = CKShare.ParticipantPermission.readWrite
self.share = share
} catch
{
error.log("ContentView")
print("Failed to create share")
}
}
Any suggestions?