Hello everybody. I am trying to save a new contact in the contact book. But I get an error in the catch block: Domain=NSCocoaErrorDomain Code=134092 “(null)”. This error only appears on Mac 13.1 Ventura. Everything works fine on iOS and MacOS 14.2.1 Sonoma. What could be the problem?
func save(_ cnContact: CNMutableContact, identifier: String? = nil) throws {
let saveRequest = CNSaveRequest()
saveRequest.add(cnContact, toContainerWithIdentifier: identifier)
do {
try CNContactStore().execute(saveRequest)
} catch {
print(error)
}
}